SQL Query Template to a different schema

Hi all
I am on MII 12.2, connecting to Oracle through a data source which references user/schema "Foo"
I would like to perform queries involving tables from schema "Bar" .
As a consequence, when I need to access Bar tables I must reference them like "Foo.<TableName>"
If I use an SQL query with mode Command I can freely write the prefix but no return is allowed
If I use mode = FixedQuery(With Output) I can't prefix "Foo." because the editor prevents me from freely entering SQL code
How can I do this? Thanks regards
Vincenzo

Thanks for your reply!
Actually there is a primary key, but Streams seems to ignore it. I've also tried the SET_KEY_COLUMNS way plus supplementary logging on the source DB, but this didn't help at all. I think this is happenening because the tables are not in the TEST_HQ schema, there are only synonyms to the real tables contained in TEST_CO.
Is there any other easy way to get Streams working between two different schemas?
Thanks again for your help!!
Max

Similar Messages

  • How to Save SQL query template as a text file

    Hi,
    How to save a SQL query template in my server as a Text file?? I tried using Text saver but it is not getting saved in the path specified.
    Sweety

    Hi Sweety,
    In the transaction editor (for business logic), add your query template to a transaction.  Add a Tracer after and link the Query property of the SQL Query action block to the Message property of the transaction.  Run the transaction and you will see your Action Block's sql script as the message from the Tracer.  You can do the same with the Server property, SD and ED, etc.
    Also if you wish to dynamically load the sql script into the query, you can do that at run time by linking a script source to the query property.  Useful to have if you have to use a complex expression to dynamically create your script.  This sometimes occurs when you have multiple filtering inputs from a webpage and you can reduce the number of tables in a complex join when the fields are left empty.  Normally this would be done as a way to improve the performance of the query.
    Hopefully this is clear.  If not I can probably provide some sample expressions.
    Regards,
    Mike

  • Oracle Sql Query issue Running on Different DB Version

    Hello All,
    I have come into situation where we are pruning sql queries on different DB version of Oracle and have performance issue. Let me tell you in brief and i really appreciate for your prompt response as its very imperative stuff.
    I have a query which is running on a DB of version 7.3.4 and it takes around 30 mins where as the same query when run on 8i it takes 15sec., its a huge difference. I have run the statistics to analyze on 7.3 and its comparatively very high. Question here is, the sql query trys to select data from same schema table and 2 tables from another DB using DB link and 2 other tables from another DB using DB link.So,how can we optimize this stuff and achieve this run as same time as 8i DB in 7.3. Hope i am clear about my question, Eagerly waiting for your replies.
    Thanks in Advance.
    Message was edited by:
    Ram8

    Difficult to be sure without any more detailed information, but I suspect that O7 is in effect copying the remote tables to local temp space, then joining; 8i is factoring out a better query to send to the remote DBs, which does as much work as possible on the remote DB before shipping remaining rows back to local.
    You should be able to use EXPLAIN PLAN to identify what SQL is being shipped to the remote DB, If you can't (and it's been quite a while since I tried DB links or O7) then get the remote DBs to yourself, and set SQL_TRACE on for the remote instances. Execute the query and then examine the remote trace files, And don't forget to turn off the tracing when you're done.
    Of course it could just be that the CBO got better,,,
    HTH - if not, post your query and plans for the local db, and the remote queries.
    Regards Nigel

  • SQL query on emp table(SCOTT Schema): Highest salary per department

    From emp table of SCOTT schema. I would like to know the name, sal,the deptno he belongs of the highest paid employee from each dept.
    Explaining further:
    The following query only returns deptno and max(sal) of each department. I need the name of the highest paid employee from each dept along with the below result.
    SQL> SELECT DEPTNO,MAX(SAL) FROM EMP GROUP BY deptno;
    DEPTNO MAX(SAL)
    30 2850
    20 3000
    10 5000

    It seems you want just one ename if two employees have the same highest salary. In that case you can use this construct:
    SQL> select deptno
      2       , max(sal)
      3       , max(ename) keep (dense_rank last order by sal)
      4    from emp
      5   group by deptno
      6  /
        DEPTNO   MAX(SAL) MAX(ENAME)
            10       5000 KING
            20       3000 SCOTT
            30       2850 BLAKE
    3 rijen zijn geselecteerd.Regards,
    Rob.

  • SQL QUERY to create new schema in Oracle 10g Express

    Can anyone provide the SQL query to create a new schema in Oracle 10g Express edition.

    Can anyone provide a SQl query to create a
    schema/user named 'test' with username as 'system'
    and password as 'manager'system user is created during database creation, it's internal Oracle admin user that shouldn't be used as schema holder.
    In Oracle database, Oracle user is schema holder there's no seperate schema name to be defined other than username.

  • Import of BaseView to a different schema in database

    Hi All,
    We have developed some bam reports. Now the base view, meta view are referring to a schema name (say SchemaName1) in database.
    In the plans we are using "SQL query" to get data from database. So we have queries like "Select SchemaName1.table1.column1 ... from ......".
    Now we have taken a export of the base view, meta view ,plans and all other components of BAM.
    All is fine till now... But now i need to import all these stuff in a different database. My problem is that in the new database instance i cannot use the same schema name (i.e. SchemaName1 ). I have a different schema name(say SchemaName2) there and i need to use that......There is no way i can use SchemaName1.
    Will the import of Base view/Meta view/plans work or we need to do some configuration changes during import??
    Do we have to create Base view for the new schema names from scratch or the imported code can be used??
    The plans have sql queries referring to SchemaName1 but we need it to refer to the Other schema(SchemaName2 )...What is the possible way of referring to the new schema without developing the plan again??
    Waiting for your valuable feedback...

    ***Backup your repository database***
    ***Please review all steps before attempting***
    Sarputil Export
    1.     Start | Run, type “sarputil”
    2.     Do a partial export. (Note down directory that will contain files to be exported.).
    3.     Select your Baseview, Metaview, Security:Login Profile, and Plan. (Note, the check boxes are in front of each object name and might appear very light on some clients.)
    4.     On the XML dialog and with the question on what you would like to do – select Execute Now.
    5.     Finish the wizard and from the directory noted above, verify .csv files were created. (Typically C:\OracleBAM\EnterpriseLink\Data\rp\export).
    6.     Copy all .csv files and paste to different temporary folder on 2nd server.
    Sarputil Import
    1.     Start | Run, type “sarputil” on the 2nd server where you’ll import into.
    2.     Partial import
    3.     Under Repository Information dialog, set the Data Source information on the right and remember to change the directory now containing your .csv files.
    4.     Like before, select “Execute now” and Finish the wizard.
    Oracle BAM Admin
    Modify connect string (host string or tns name) if you need to:
    1.     Connect in Oracle BAM Admin
    2.     Expand Baseviews and select the imported Baseview
    3.     Check under “Server” on the left if the connect string is correct.
    4.     If not, click Modify button and change.
    Modify Baseview Login if you need to:
    1.     With your Baseview still selected on the left side, click on “Baseview Logins” tab
    2.     Logins on the left correspond to actual database user id’s and password. Add a new Login with a database User ID and Password to access the new schema.
    3.     Associate or Set the new Login (right) to the BAM User on the left.
    Sarpbv Modification
    Use sarpbv utility to change references of the old schema name to a new schema name.
    General syntax for Oracle:
    sarpbv /R"username:pwd:Oracle:TNS Name::DB UserID:DBUser pwd” /B"BaseView name" /O"NewSchema"
    **Use Capital letters for New Schema name!
    **Notice 2 colons (::) after TNS Name (because you do not have a database name in Oracle).
    1.     Open DOS
    2.     Type your sarpbv command. Below is an example where I changed a Baseview called “scott” to use a new schema name called Jack.
    sarpbv /R"sa::ORACLE:baminst::sagent:sagent" /B"scott" /O"JACK"
    3.     Open Design Studio, locate the plan and check the SQL Query now reflects the new schema.
    4.     Test the plan to ensure it’s pulling data correctly from the new schema.

  • How to use ColumnList MOde in Query Template

    Hi,
    I am working on SAP MII 11.5 and having trouble with SQL Query Template with Column List mode.
    It is throughing an error "Enter a table Name.
    Please help me in this regard

    You will need to use the Group parameter with the table name.
    <PARAM NAME="Group" VALUE="Employees">
    You can also set it with javascript for interactive use that would emulate the Template Editor:
    document.APPLET.getQueryObject().setGroup("Employees");

  • Data server switch in SQL query

    Hi guys,
    I have a question about data server switch in the sql query template. We have been developing all the sql queris pointing to the customer test db server say "TESTDB", now we have to change the db connection to "PRODUCTDB", do we need to change sql queries one by one or is there a better solution for this? I think this is a common requirement to change back and forth data server connection for a bulk number of queries
    Thanks,
    Tony.

    Tony,
    From a design perspective it is advisible to name your data servers in a more abstract way, since the query templates themselves only save the Name of the data server in them.  Data Servers also have a description field (typically overlooked) which will appear in the list and the workbench where you can be explicit or to even serve as a reminder that you are working with either test or production data.  The true 'switch' should happen when you reconfigure your data server settings for server url and user/pwd.
    TESTDB and PRODUCTDB might be better served with a meaningful name that provides a correlation to the data stored in the database.  In more mature system landscapes having a DEV/QA/PROD arrangement of MII servers, the ability to promote content comes from configuration and projects, not from actually changing the content on the same server.
    If you need to rapidly modify your content to adopt this practice then I would simply export the associated project and unzip it to a folder.  Then use windows explorer to do a search for files containing your data server name (they will appear in your query templates as Server="TESTDB").  With a text editor that can do search and replaces across multiple files (http://www.editplus.com is my personal favorite) you can easily change the data server name to a better convention.  Then zip up the folder content and reimport the project.  This will effectively switch your data servers (don't forget to create the new abstract data server in place of the TESTDB and PRODUCTDB).
    Regards,
    Jeremy

  • Error : Query Templates

    hi all,
    In Query Templates(SQL and TAG), while selecting server name, its not displaying "modes" for it.
    In Java console it is showing error as
    <b>ERROR - Server is currently disabled (IDBC).
    ERROR - The execution mode (CurrentWrite) is not supported with this Server or Content-Type.</b>
    The connection is enabled in xMII. And i have also checked the connection status and it is showing success.
    Where can i check the status for IDBC server?
    Please help me
    Thanks in advance
    Muzammil

    Hi Jamie,
    Below given the log details from Java console . I have tried opening SQL Query Template. I cant understand why it is showing error in mode CurrentWrite even i am trying to  open SQL Query Template...
    ConsoleLogger::Creating NEW instance...
    ConsoleLogger::Creating NEW instance...
    ConsoleLogger::Debug is true
    ConsoleLogger::Debug is true
    Attempting to read localization information
    execute(http://locolhost/Lighthammer/Illuminator,null,Language=&FileName=Messages&Service=Localization&Content-Type=raw/binary) called
    Localization information has been loaded.
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Service=PropertyAccessService&Mode=Retrieve&Content-Type=raw/binary&PropName=IllumLoginName) called
    Username is muzammil
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Content-Type=raw/binary&Service=PingToken&Token=TemplateEditor&ObjectName=SystemPermissionMaps) called
    Attempting to read localization information
    execute(http://locolhost/Lighthammer/Illuminator,null,Language=&FileName=Applet&Service=Localization&Content-Type=raw/binary) called
    Localization information has been loaded.
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ServerListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ServerBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ModeListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ModeBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TimePeriodListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TimePeriodBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ScheduleListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ScheduleListBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/GroupListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/GroupBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TagListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TagBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TableListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TableBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ColumnListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ColumnBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/AlarmColumnListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/AlarmColumnBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionFolderListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionFolderBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionOutputListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionOutputBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionInputListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionInputBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/FolderListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/FolderBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TemplateListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TemplateBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,&Service=TemplateService&Mode=FolderList&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,&Service=TemplateService&Mode=TemplateList&Folder=&DocType=Query&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&TemplateName=Defaults/AggregateQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/CubeListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/CubeBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/SAPVariableListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/SAPVariableBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/DimensionListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/DimensionBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/MeasureListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/MeasureBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Defaults/SQLQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Defaults/TagQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=&Service=Admin&Mode=RoleList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=muzammil&Mask=&RowCount=60&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    User role: Administrators
    User role: Developers
    User role: Everyone
    User role: Security
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=Illuminator&Server=&Service=SystemInfo&Mode=ServerList&Method=SQL&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=IDBC&Service=&Mode=CurrentWrite&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&StartDate=&EndDate=&Time=&TimePeriod=&Schedule=&AllowFuture=true&Duration=60&DurationUnits=M&IntervalCount=1&NumberFormat=0.00&DateFormat=MM%2Fdd%2Fyyyy+HH%3Amm%3***&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = -100
    ERROR - Server is currently disabled (IDBC).
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=Illuminator&Server=&Service=SystemInfo&Mode=TimePeriodList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=Illuminator&Server=&Service=SystemInfo&Mode=ScheduleList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=&Service=Admin&Mode=RoleList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=60&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=Local_Oracle&Service=&Mode=CurrentWrite&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&StartDate=&EndDate=&Time=&TimePeriod=&Schedule=&AllowFuture=true&Duration=60&DurationUnits=M&IntervalCount=1&NumberFormat=0.00&DateFormat=MM%2Fdd%2Fyyyy+HH%3Amm%3***&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = -100
    ERROR - The execution mode (CurrentWrite) is not supported with this Server or Content-Type.
    Regards
    Muzammil

  • Need to retrieve number of rows affected by SQL query

    Hi,
    I am executing some update queries in SQL in a xMII transaction. Iam using a SQL Query template for the same and I need to find out how many records were affected by the last executed statement. I have tried doing SELECT @@ROWCOUNT in a second SQL template that executes after the UPDATE SQL Query Template. However, the results are intermittent, sometimes it returns 1 row affected as expected but sometimes returns 0 rows. Can anyone help on this.
    Thanks

    Anamika,
    1) As per sql best practices use of trigger is not recommend unless you don't have any other option because usually triggers consume more resources and IO since it involves internal monitoring.
    2) @@ROWCOUNT should go in same SQL session where you are performing update to identify rows affected else as you said earlier your results will not be accurate
    3) The other alternative is to create a Stored Procedure but it again boils down to your authorization issue. This would be easier and better if you have authorization to create SP's. But nevertheless give it a try.
    4) Lets forget about SP say that you have an Update Statement like
    Update Table1 set column2 = 'abc' where Column2 = 'xyz'
    In this case it is evident that you know what you are passing into the Where clause and to what table hence its obvious that you also know how many rows will be affected by using query,
    Select count(*) from Table1 where Column2 = 'abc'
    The @@ROWCOUNT is powerful within t-sql with SP, cursors etc..
    Hope this helps!!
    Regards,
    Adarsh

  • Executing BLS Transaction through Xacute query template?

    Hi Experts,
    Am having a SQL query template for which am passing value from web page after user input and i have added this SQL in my BLS transaction in illumSQL action block. I have created Xacute query template and display template(iGrid) for displaying output from transaction.
    Problem am facing is that am not able to execute my transaction after passing values to SQL query. How to get this working?
    Regards,
    Ravi Shankar

    Hi som sarkar,
    Let me explain my problem this way, let say am having SQL Fixed query and am doing some field selection based on the parameter which is been passed to the query template.
    -Checked the query template returning values, working good.
    created one Display template to display whatever been fetched by query template(iGrid).
    -Generated applet working good.
    Now if i pass the parameters from webpage to SQL query(parametes are mapped in query template) and update the grid, it should work right but its not...
    Thats what i was trying to ask you so far.
    Regards,
    Ravi Shankar

  • Different LOV behavior between SQL query data model and data template

    I have noticed different behavior when using parameters linked to list of values (LOV) of type menu with the multiple selection option enabled and a SQL query data model vs a data template. Here's the example because that first sentence was probably really confusing.
    SQL Query:
    select
    plmc.MonthCode, plmc.ModalityDim, plmc.ModalityName,plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(:modalityDim,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (:modalityDim)
    then 1
    else 0
    end
    end
    Putting BI Publisher into debug mode, defining a data model of type SQL Query, defining a parameter called :modalityDim linked to a LOV that allows multiple selections, and selecting a couple of values from the LOV the output of the prepared statement is:
    [081607_122647956][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?,?)
    then 1
    else 0
    end
    end
    [081607_122647956][][STATEMENT] 1:6
    [081607_122647956][][STATEMENT] 2:7
    [081607_122647956][][STATEMENT] 3:6
    [081607_122647956][][STATEMENT] 4:7
    [081607_122654713][][EVENT] Data Generation Completed...
    [081607_122654713][][EVENT] Total Data Generation Time 7.0 seconds
    Note how the bind variable :modalityDim was changed into two parameters in the prepared statement.
    When I use this same SQL Query in a data template the output is:
    [081607_012113018][][STATEMENT] Sql Query : select
    plmc.MonthCode,
    plmc.ModalityDim,
    plmc.ModalityName,
    plmc.RegionDim
    from
    DataOut.dbo.PatientLabMonthlyCross plmc
    where
    plmc.MonthCode = 200202
    and plmc.RegionDim = 1209
    and 1 =
    case
    when coalesce(?,null) is null
    then 1
    else
    case
    when plmc.ModalityDim in (?)
    then 1
    else 0
    end
    end
    [081607_012113018][][STATEMENT] 1:'6','7'
    [081607_012113018][][STATEMENT] 2:'6','7'
    [081607_012113574][][EXCEPTION] java.sql.SQLException: Syntax error converting the nvarchar value ''6','7'' to a column of data type int.
    Note the exception because it is trying to convert the multiple parameter values.
    Am I doing something completely wrong here? I really need to use a data template because I will need to link a couple of queries together from different database vendors.
    -mark

    This is for 10.1.3.4 - because in 11g every SQL query is automatially part of a data model.
    In 10g SQL query is for simple unrelated SQL queries.
    If you need to use advance features such as:
    a) multiple SQL queries that are joined in master-detail relation ships
    b) before/after report triggers
    Then you will need to use the data template, which is an XML description
    of the queries, links, and PL/SQL calls.
    hope that helps,
    Klaus

  • Dbms_sql  in a different schema from query table-error  ** ORA-00942

    Oracle Experts,
    I think I am having problems with using DBMS_SQL in which the function was created in one schema and the query table was created in a different schema.
    We have 2 schemas: S1, S2
    We have 2 tables:
    T1 in Schema S1
    T2 in Schema S2
    We have a function F1 created by DBA in schema S1 that uses the dbms_sql as:
    CREATE OR REPLACE FUNCTION S1.F1(v1 in VARCHAR2) return NUMBER IS
    cursor1 INTEGER;
    BEGIN
    cursor1 := dbms_sql.open_cursor;
    dbms_sql.parse(cursor1, v1, dbms_sql.NATIVE);
    dbms_sql.close_cursor(cursor1);
    return (0);
    EXCEPTION
    when others then
    dbms_sql.close_cursor(cursor1);
    return (1) ;
    END;
    I am using jdeveloper 11G. We have an Oracle DB 11g.
    We have a java program which uses jdbc to talk to our Oracle DB.
    Basically, in my java program, I call function F1 to check if the query is valid.
    If it is, it returns 0. Otherwise, returns 1:
    oracle.jdbc.OracleCallableStatement cstmt = (oracle.jdbc.OracleCallableStatement) connection.prepareCall ("begin ? := S1.F1 (?); end;");
    cstmt.registerOutParameter (1, java.sql.Types.INTEGER);
    cstmt.setString(2, "Select * from S2.T2");
    cstmt.execute ();
    Since the table that I run the query is T2, created in different schema than F1 was created in, I have the error:
    ** ORA-00942: table or view does not exist
    So my questions are these:
    - I am using Oracle DB 11g, if I run the query on a table that created in a different schema from the one that the function (which uses dbms_sql) was created in, I would get the error ORA-00942?
    - If I runs the query on table T1 in the same schema as the function F1, would I have the same problem(The reason I ask is I cannot create any table in schema S1 because the DBA has to do it; I am not a DBA)
    - This is not a problem, but a security feature because of SQL injection?
    - How to resolve this issue other than creating the table in the same schema as the function that utilizes DBMS_SQL?
    Regards,
    Binh

    Definer rights (default) stored objects run under owner's security domain and ignore role based privileges. So regardless what user you are logged in as, function S1.F1 always executes as user S1 and ignores user S1 roles. Therefore exeuting statement within S1.F1:
    Select * from S2.T2requires user S1 to have SELECT privilege on S2.T2 granted to S1 directly, not via role.
    SY.

  • Combine tables from 2 SQL servers with different Schemas and update as new data is entered

     I have 2 SQL server 2000 machines, I need to take a table from each one and combine them together based on a date time stamp.  The first machine has a database that records information based on an event it is given a timestamp the value of variable is stored and a few other fields are stored in Table A.  The second machine Table B has test data entered in a lab scenario.  This is a manufacturing facility so the Table A data is recorded by means of a third party software.  Whenever a sample is taken in the plant the event for Table A is triggered and recorded in the table.  The test data may be entered on that sample in Table B several hours later the lab technician records the time that the sample was taken in Table B but it is not exact to match with the timestamp in Table A.  I need to combine each of these tables into a new SQL server 2005 database on a new machine.  After combining the tables which I am assuming I can based on a query that looks at the timestamp on both Tables A & B and match the rows up based on the closest timestamp. I need to continuously update these tables with the new data as it comes in.  I havent worked with SQL for a couple of years and have looked at several ways to complete this task but havent had much luck.  I have researched linked servers, SSIS, etc Any help would be greatly appreciated.

    Hi Catalyst,
    Welcome to the MSDN Forums!
    I would have a concern with respect to your issue.  If there is no way to identify a sample, save for the closest timestamp on table A - what would happen if two samples were taken in the plant, and the test results were entered in reverse order?  The samples would not tie back to the appropriate measurements.  Can't you get an identifier of some sort to tie that sample back to table A?
    If you can't, something like this should work, but I'm not sure how you'll "serialize" the samples to avoid the situation above.
    Code Snippet
    --Create sample data
    DECLARE @TableA TABLE ( SampleNo int NOT NULL,
    SampleTime datetime);
    DECLARE @TableB TABLE ( SampleTakenTime datetime,
    SampleColour varchar(50),
    SampleQuality char(1),
    SampleResultNo int);
    INSERT @TableA SELECT 1, GETDATE()
    WAITFOR DELAY '00:00:10';
    INSERT @TableB SELECT GETDATE(), 'Orange', 'A', '5'
    WAITFOR DELAY '00:00:20';
    INSERT @TableB SELECT GETDATE(), 'Purple', 'D', '7'
    WAITFOR DELAY '00:00:10';
    INSERT @TableA SELECT 2, GETDATE()
    --Actual Query begins now
    SELECT *
    FROM @TableA AS a
    JOIN @TableB AS b ON ABS(DATEDIFF(millisecond,a.SampleTime,b.SampleTakenTime)) = (SELECT MIN(ABS(DATEDIFF(millisecond,ta.SampleTime,tb.SampleTakenTime)) )
    FROM @TableB tb
    JOIN @TableA ta ON a.SampleNo = ta.SampleNo)
    Now, to account for the fact that you are querying data from a different server, you need to create a linked server (see sp_addlinkedserver and sp_addlinkedsrvlogin) and then use the fully qualified name (server.database.schema.table) to reference the table.
    Hope this helps,
    Aaron

  • Dynamically change schema/user name in sql query

    I have tables with same name in different schema.
    and Suppose I have query like:
    select * from myHR.emp;
    Now I want to pass variable in place of myHR, may be as follows:
    Declare
    vSH varchar2(10);
    Begin
    vSH := 'myHR';
    select * from vSH.emp;
    End;
    But I got error with this query.
    I want to pass variable as scheme_name/user.
    So, please help me with this.
    Thanks in advance.

    Like said before, it is no different than running any other SQL statement from the client.
    All you have to do is run a ALTER SESSION statement immediately after opening the connection:
    SQL> alter session set current_schema = your_company_specific_schema_name ;or you can create synonyms under the Oracle user that you use to connect to the database and these synonyms will point to the correct schema.table that needs to be accessed. Then your queries will simply use the synonym as if it were the actual table without caring where the actual table is located.
    Justin is faster even considering its a friday.
    Message was edited by:
    Kamal Kishore

Maybe you are looking for

  • G5 having a host of problems after 10.4.8 update

    Does anyone know how or if there is way to go back to 10.4.7 now that I'm running 10.4.8? My G5 use to crash at startup about 30-40% of the time right out of the box. Yes I have one the (Late 2004) 1.8GHz G5's. These problems continued until Apple fi

  • Help required in using Javanbean in forms

    Can any one can write me the easy steps of how to use Javabean in a form. I am using D.S 9i.... Thanks

  • Linux distributions supported on Oracle 8i and 9i

    Hello, Can you please provide me with the web page which compiles certification information on Linux distributions for 8i and 9i, I cannot seem to find a page which does such a compilation. Also, this is to the responder - do you work for Oracle? Tha

  • Stop the iMac screen while using an external monitor.

    I succeeded to play an .avi file in full screen on my 32" samsung lcd...but i would like to stop the iMac monitor while watching the avi. If i choose to stop the iMac monitor also the tv screen became black, and also if i start a screensaver on the i

  • Iphone migration to new mac

    I purchased a new late 2013 13" MacBook Pro with Retina.  I am trying to get the iPhoto Library from my old 2010 MacBook Pro into the new one. I go into the new one's iPhoto and go to File, Import Library. I see the file on the old MacBook but it is