XML Publisher - can we specify multiple SQL statements in the report?

Hi there,
can we specify multiple SQL statements in the report with XML Publisher?
Regards,
Liviu

Could we eventually generate with the Wizards available in XML Publisher desktop 5.6.2 an xml file with a structure like the one given below? The reason is to facilitate creation of the two rowsets. Thanks, Liviu.
<?xml version="1.0" encoding="UTF-8"?>
<DATA>
     <ROWSET2>
          <ROW2>
               <FIELD1>Query1</FIELD1>
               <FIELD2>field2</FIELD2>
               <FIELD3>field3</FIELD3>
          </ROW2>
     </ROWSET2>
     <ROWSET>
          <ROW>
               <FIELD1>Query2</FIELD1>
               <FIELD2>field2</FIELD2>
               <FIELD3>field3</FIELD3>
          </ROW>
     </ROWSET>
</DATA>

Similar Messages

  • How to execute multiple SQL statements thru frontend?

    With SQL Server database, you can execute multiple SQL statements.
    Ex.
    SQLCommand cmd = new SQLCommand();
    cmd.CommandText = "SELECT * FROM EMP; SELECT * FROM DEPT";
    cmd.ExecuteXXX();
    Note that for SQL Server, ";" (semocolon) is used as a separator.
    What separator is required for Oracle ? Or rather, can I execute multiple SQL statements against Oracle database (10g) ?
    (Why I want to do it is a totally diff. subject !)
    Thanks,
    Ami.

    Hello,
    You could use an anonymous PL/SQL block to batch multiple statements.
    If you want to use SELECT statements, you would open a REF CURSOR for each SELECT and return the REF CURSOR to your application. INSERT, UPDATE, and DELETE statements can just be passed as is.
    A simple REF CURSOR example might look like:
    begin
      open :v_refcursor1 for select * from emp;
      open :v_refcursor2 for select * from dept;
    end;Where v_refcursor1 and v_refcursor2 are parameters defined as a REF CURSOR type.
    Hope that helps a bit...
    - Mark

  • Multiple SQL statements in Init SQL in WLS 8.1

    How to seperate multiple SQL statements in Init SQL text box ?
    For example, I want to enter following two SQL statements. How do I seperate them.
    I tested with / and ; as seperator, but did not worked..
    alter session set nls_date_format = 'MM/DD/YYYY'
    set role xxx_role identified by xxxx

    Mahendra wrote:
    Thanks Joe.
    Following worked for Oracle 8.1.7Good news.
    but did not for 8.0.6
    SQL BEGIN EXECUTE IMMEDIATE 'ALTER SESSION SET nls_date_format = ''MM/DD/YYYY''';
    EXECUTE IMMEDIATE 'SET ROLE xxx identified xxx'; end;
    Do you know 8.0.6 syntax ?You might try asking oracle, but note that no one is supporting that old version
    of Oracle any longer...
    Joe
    >
    Mahendra
    Joe Weinstein <[email protected]> wrote:
    Hi.
    I found the syntax, I think. Try this:
    BEGIN EXECUTE IMMEDIATE 'ALTER SESSION SET nls_date_format = 'MM/DD/YYYY'';
    EXECUTE IMMEDIATE 'SET ROLE <<role name>> identified
    by <<pwd>>';END;
    Joe
    Mahendra wrote:
    Still getting following exception.
    <Feb 19, 2004 1:47:58 PM EST>
    <Warning>
    <JDBC> <BEA-001164>
    <Unable to initialize connection in pool "XXXX".
    Initialization
    SQL = "BEGIN alter session set nls_date_format = 'MM/DD/YYYY'; setrole xxxx_role
    identified by
    xxxx; END;".
    Received exception: "java.sql.SQLException: ORA-06550: line 1,column7:
    PLS-00103: Encountered the symbol "ALTER" when expecting one of thefollowing:
    begin declare exit for goto if loop mod null pragma raise
    return select update while <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql commit <a single-quoted SQL string>
    The symbol "update was inserted before "ALTER" to continue.
    ORA-06550: line 1, column 61:
    PLS-00103: Encountered the symbol "ROLE" when expecting one of thefollowing:
    transaction
    ".>
    <Feb 19, 2004 1:47:59 PM EST> <Notice> <WebLogicServer> <BEA-000355><Thread "Li
    Joe Weinstein <[email protected]> wrote:
    Mahendra wrote:
    Thanks for reply, but that did not worked.
    Get following exception
    Unable to initialize connection pool "POOL_NAME".
    Initialization SQL = "Select count(*) from ""SQL BEGIN alter sessionset nls_date_format
    = 'MM/DD/YYYY'; set role xxx_role identified by xxxx; END;"". Receivedexception:
    "java.sql.SQLException: ORA-00972: identifier is too long
    Since we have not given SQL before that statement, BEA is treating
    statment "SQL Begin ....." as a table name.
    Then I tried by putting SQL out side quotes, like SQL "Begin .....end;" but the
    same error.
    Is there any way around it ?
    MahendraHi. The full string you should enter into the console when you define
    the
    initSQL parameter is:
    SQL BEGIN alter session set nls_date_format = 'MM/DD/YYYY'; set role
    xxx_role identified by xxxx; END;
    Let me know...
    Joe
    Joe Weinstein <[email protected]> wrote:
    Mahendra wrote:
    How to seperate multiple SQL statements in Init SQL text box ?
    For example, I want to enter following two SQL statements. How do
    I
    seperate them.
    I tested with / and ; as seperator, but did not worked..
    alter session set nls_date_format = 'MM/DD/YYYY'
    set role xxx_role identified by xxxxThis will always be DBMS-specific. If this is for oracle, you can
    try:
    "SQL BEGIN alter session set nls_date_format = 'MM/DD/YYYY'; setrole
    xxx_role identified by xxxx; END;"
    Joe

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • How to execute multiple sql statements

    hi all
    i am wondering if i can execute multiple sql statements in one shot with >> execute immediate command
    for example:
    i define the variable as X := sql statement
    Y := sql statement
    z := sql statement
    can i do execute immediate (X,Y, Z);
    if yes how ?? and if not any possible alternate
    thanks

    Starting with Ganesh's code
    DECLARE
       l_statement                 VARCHAR2 (2000);
       v_passwd                    VARCHAR2 (200);
       v_username                  VARCHAR2 (200) := 'test';
       v_pwd_key                   VARCHAR2 (200) := 'lwty23';
       v_dblink_name               VARCHAR2 (2000);
       v_dblink_drop               VARCHAR2 (2000);
       v_dblink_create             VARCHAR2 (2000);
       v_dblink_check_connection   VARCHAR2 (2000);
       l_number                    NUMBER;
    BEGIN
       --<<c_instance>>
       FOR c_instance IN (SELECT *
                            FROM v_oracle_instances
                           WHERE environment = 'Developement')
       LOOP
          SELECT encpwd_owner.display_db_encpwd (v_username,
                                                 c_instance.host_name,
                                                 c_instance.instance_name,
                                                 v_pwd_key)
            INTO v_passwd
            FROM DUAL;
          v_dblink_name := c_instance.host_name || '_' || c_instance.instance_name;
          v_dblink_create :=
                ' CREATE DATABASE LINK '
             || v_dblink_name
             || ' CONNECT TO '
             || v_username
             || ' '
             || 'IDENTIFIED BY '
             || v_passwd
             || ' USING'
             || ' ''(DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST= '
             || c_instance.host_name
             || ')(PORT='
             || c_instance.LISTENER_PORT
             || '))(CONNECT_DATA=(SID='
             || c_instance.instance_name
             || ')))''';
          v_dblink_check_connection := 'select 1 from global_name@' || v_dblink_name || '.QCM';    --- Notice this change. I am simply selecting 1. That should be enough to test the database link.
          v_dblink_drop := 'drop database link ' || v_dblink_name || '.QCMTLAF';
          -- l_statement := 'BEGIN ' || v_dblink_create ';' || v_dblink_check_connection ';' || v_dblink_drop '; END ;'
          BEGIN
              EXECUTE IMMEDIATE (v_dblink_create);
              DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Created');
         EXCEPTION
            WHEN others THEN
               dbms_output.put_line( 'Failed to create the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <<list of values>> );
         END;
          EXECUTE IMMEDIATE (v_dblink_check_connection) INTO l_number;    --- Notice this.
          DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Tested');
          BEGIN
             EXECUTE IMMEDIATE (v_dblink_drop); 
             DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Dropped');
          EXCEPTION
             WHEN others THEN
               dbms_output.put_line( 'Failed to drop the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <<list of values>> );
         END;
       END LOOP;
    END;But I agree with the point that others have brought up that it really doesn't make sense to create and drop a database link like this.
    Justin

  • Excuting multiple sql statements

    Hi to everybody.
    I'm quite new to Oracle even if i have quite a big experience with MySQL and SQL commands. I'm facing a problem that I suppose it is a really basic one.
    I received a dump of an Oracle database in a .sql format. I mean that both the schema and the data are build through a large number of sql statements. In particular the schema is made through a lot of "create table ..." while the data are built through "insert into..". My need is to import these database in a fresh Oracle database Oracle 10 g XE.
    I've installed it on a Debian system and i can succesfully execute a single SQL command both through the web interface http://localhost:8080/apex and logging as oracle user through the sqlplus username/passwd command.
    My problem is that the data are split on about 12000 SQL "INSERT INTO.." so executing all of them one by one could be a little annoying :-)
    <u>So I'm asking if there is a way to instruct Oracle to execute multiple SQL statements reading it from a file (like MySQL does for example).</u>
    I' m considering to write a script to do it if there's no better way. I know that there're better way to dump databases in Oracle but I can change the .sql format since it is the only one that I got.

    in SQL*Plus you can execute a SQL file with the start command or it's shorthand version @:SQL> start filename.sql
    or
    SQL> @filename.sql

  • Executing multiple SQL statements fails using ODBC

    Executing multiple SQL statements will fail with error 'ORA-00911 invalid character' when connecting to an Oracle database using ODBC driver version 8.01.07.00.
    When I use either my application or the Oracle ODBC Test client utility connecting using ODBC driver version 8.01.07.00 I can only get a single CALL statement (as shown below) to execute:
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','
    ','Event File
    Name','\\KILLIANS\BATCHCTL\SampleDemo1\JOURNALS\1.evt','','AREA1','','','','','','1','','','','','',' ','');
    When I try to execute the following string with multiple CALL statements (as shown below) it fails with the following error being returned - ORA-00911: invalid character
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','
    ','Event File
    Name','\\KILLIANS\BATCHCTL\SampleDemo1\JOURNALS\1.evt','','AREA1','','','','','','1','','','','','',' ','');
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD
    HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','Version','Recipe Header','1.0','','AREA1',' ','
    ','','','','1','','','','','',' ','');
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD
    HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','Version Date','Recipe Header','5/18/2001 1:28:32
    PM','','AREA1',' ',' ','','','','1','','','','','',' ','');
    CALL BHInsert (TO_DATE('2003.07.23
    10:04:28','YYYY.MM.DD HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','Author','Recipe Header','Mark
    Shepard','','AREA1',' ',' ','','','','1','','','','','',' ','');
    I've tried adding a line feed in addition to the space at the end of each call but that doesn't seem to help. Also have tried unsuccessfully to change the seperator used between each call using various valid continuation characters.
    Executing multiple CALL statements from within Oracle's SQL Worksheet connecting as the same user and password, as my application executes successfully. However when I try this from within the Oracle ODBC test client, it fails with the same ORA-00911 error that I'm seeing in my application.
    I'm currently trying the more recent ODBC drivers, however any ideas or suggestions would be greatly appreciated.

    Can you take the begin ... end block and run it using SQL*Plus?
    I can't think of any documentation that would specifically answer this question. I'm sure if you read & absorbed the ODBC Programmers Reference (2000+ pages) you'd be able to find out, but I don't know of a quick way to find out.
    You can enable SQL*Net tracing. There are a fair number of options for enabling this tracing-- http://tahiti.oracle.com has all the Oracle manuals online, which should give you enough info to configure exactly what you want.
    I would suggest, however, that you look into more performant/ scalable alternatives rather than going too far down this path. A block with lots of SQL statements with literals isn't going to make your database happy even if you get it to work.
    Justin

  • Multiple sql statements

    Hey all
    How do I create multiple sql statements? I know how to add a single line, but how do I efficiently insert multiple lines? Should I create a new string called "qry2" and then just add that to my executeUpdate statement?
    //dbtest.jsp
    String qry = "INSERT INTO item VALUES ('" postedItem "', '" stamp "');";
    addStmt.executeUpdate(qry);

    You can have a separate variable, or you can just reuse qry.
    As a side note, I strongly recommend you use PreparedStatement rather than Statement, and use its "?" parameters for the values you're going to insert: qry = "INSERT INTO item VALUES(?, ?)";
    qry.setString(1, postedItem);
    qry.setTimestamp(2, stamp); // or setString, or whatever type is appropriate for stamp

  • How can i use one SQL statement to solve problem?

    How can i use one SQL statement to solve the question below?
    For a Table named A, there is a column named F(char type).
    Now select all the records where F like '%00' and update their F value to '%01'
    Just one SQL statement.Do not use PL/SQL block.
    How to do that?
    Thanks.

    What is the data volume for this table?
    Do you expect lots of rows to have '%00' as their value?
    Following two statements come to mind. Other experts would be able to provide better alternatives:
    If you have index on SUBSTR(f, 2):
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) || '01'
    WHERE  substr(f,
                  -2) = '00';If most of the rows have pattern '%00':
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) ||
               DECODE(SUBSTR(f,
                             -2),
                      '00',
                      '01',
                      SUBSTR(f,
                             -2));

  • XML Publisher(XDODTEXE) in EBS taking more time with the same SQL in TOAD

    HI
    XML Publisher(XDODTEXE) in EBS taking more time with the same SQL in TOAD.
    The sql has 5 union clauses.
    It takes 20-30 minutes in TOAD compared to running through Concurrent Program in XML Publisher in EBS taking around 4-5 hours.
    The Scalable Flag at report level is turned on with the JVM options set to -Xmx1024m -Xmx1024m in Concurrent Program definition.
    Other configurations for Data Template like XSLT, Scalable, Optimization are turned on though didn't bounce the OPP Server for these to take effect as I am not sure whether it is needed.
    Thanks in advance for your help.

    But the question is that how come it is working in TOAD and takes only 15-20 minutes?
    with initialization of session ?
    what about sqlplus ?
    Do I have to set up the the temp directory for the XML Publisher report to make it faster?
    look at
    R12: Troubleshooting Known XML Publisher and E-Business Suite (EBS) Integration Issues (Doc ID 1410160.1)
    BI Publisher - Troubleshooting Oracle Business Intelligence (XML) Publisher For The Oracle E-Business Suite (Doc ID 364547.1)

  • Submitting XML Publisher Concurrent Program through PL/SQL

    Hi,
    I am trying to submit a XML Publisher concurrent program through PL/SQL API fnd_request.submit_request.
    The request gets fired and completes successfully but it doesn't pick up the default template attached to it. Its output is plain XML but expected output is PDF report.
    However when I submit this report from SRS, it picks up the default template and gives output in PDF.
    Please let me know what could be going wrong?
    Regards,
    Nitin

    Check out the FND_REQUEST.ADD_LAYOUT API. You need to call it before you submit your report.
    Cheers,
    Dave

  • How Can i specify multiple server names in rwservlet.properties  file?

    How Can i specify multiple server names in rwservlet.properties file without clustering?
    I am using oracle 10g Application server. we have 3 servers Repsvr1, RepSvr2 and RepSvr3. Now i need to configure rwservlet.properties file to point to these servers based on any running report. i got 3 keymap files with reports info.
    Sample entry in the key map file is:
    key1: server=Repsvr1 userid=xxx/yyy@dbname report=D:\Web\path1\path2\reports\Report1.rdf destype=cache desformat=PDF %*
    key2: server=Repsvr2 userid=xxx/yyy@dbname report=D:\Web\path1\path3\reports\Report2.rdf destype=cache desformat=PDF %*
    rwservlet.properties file letting me to enter only one servername. Even though i merged all 3 keymap files into 1, still i have the server name issue. If i leave the server to the default name still i am getting the below error.
    REP-51002: Bind to Reports Server Repsvr1 failed. However, i know the default rep_<servername> would be used incase we dont have SERVER=<value> parameter in the rwservlet.properties file.
    If i specify the servername in the rwservlet.properties file then only Repsvr1 reports are working fine and other 2 server reports are giving the same error like
    REP-51002: Bind to Reports Server <<Server Name>> failed.
    how can i configure the info which will work all 3 reports. 2 Port servers are invoking using oracle forms and report server is invoking using ASP pages.
    If i specify Server name & Key map file in rwservlet.properties one at a time, all the reports are working without any error, whenever i am trying to integrate all 3 to workable i am getting binding error. if i exclude the server from rwservlet.properties still i am getting the same error.

    My RELOAD_KEYMAP setting is YES only.As i said If i specify Server name & Key map file in rwservlet.properties one at a time, all the reports are working without any error.
    keymap file entries
    key1: server=Repsvr1 userid=xxx/yyy@dbname report=D:\Web\path1\path2\reports\Report1.rdf destype=cache desformat=PDF %*
    key2: server=Repsvr2 userid=xxx/yyy@dbname report=D:\Web\path1\path3\reports\Report2.rdf destype=cache desformat=PDF %*
    If i use http://server.domain:port/reports/rwservlet? cmdkey = key1 should bring the report from Repsvr1 and http://server.domain:port/reports/rwservlet? cmdkey = key2 should bring the report from Repsvr2, but i am getting an error from Repsvr2 saying that REP-51002: Bind to Reports Server repsvr2 failed.
    Only Servername Repsvr1 is in rwservlet.properties file. Now what is the best option to by pass the server from rwservlet.properties file and should be from keymap file. if i comment server name in rwservlet.properties file still i am getting REP-51002: Bind to Reports Server <<Server Name>> failed error for both keys.

  • How can I write a SQL statement which checks if a table exists?

    How can I write a SQL statement which tells me whether a table exists?

    execute an sql query: select * from <tablename>
    catch the exception n check whether the erroe code
    matches the one that occurs for table doesn't exist
    that's itHow is your answer any different from the one given in the first reply?
    It isn't.
    As WorkForFood says DatabaseMetaData has a bunch of methods for getting information about tables but this is more useful when you don't know the names of any of the tables.. it sounds like you do so I would concur SELECT from table is probably the quickest way to go. If it helps the Xopen error should be either S1000 or 42S01 (I think) but I would try and see if there is a specific vendor code for table not found/not exists error and check for that.

  • CF8 cfquery multiple sql statements

    In CF8, when I run a cfquery against MS SQL 2005 with
    multiple SQL statements, the query return the result of the first
    statement not the last one as in CF7. The following code snippet
    will cause an error because myID doesn't exist in qry. I know I
    should set a "result" variable to get the identity key in CF8 but
    we have some sites deployed in CF7. Before all sites migrate to
    CF8, I would like to have a way to use the same code for both CF7
    and CF8 so I don't have to maintain two versions. BTW, I tried
    three datasourcr drivers: "Microsoft SQL Server", "Other" with
    JDBC, and "ODBC Socket" with SQL Native Client. All of them gave
    the same result. Please help. Thanks.

    Hi Alex Pai,
    Coincidentally, someone just asked a similar question
    here.
    So you might try searching the forums first. The query in the other
    thread is slightly different, but the answer is the same.
    Totally unrelated to your problem, but for SQL 2000/2005 you
    should use scope_identity(), not @@identity.

  • How to run multiple sqls in one jasper report

    Hello!
    Is there any one that can help me in integrating/ viewing my xml file to the web. I have my GUI in jsp format, the jsp makes a call to the bean class and then finally bean class hit my reports java class.The report java class generates the report and shows it in the new window.
    The problem is with writing mutiple sql queries and showing the result from multiple sql queires in one report.
    I do not know how to write multiple queries for just 1 report. I can give a simple example of my problem also.
    My report is as follows:
    First Name Middle Name Last name
    Sandeep               Pathak
    Now First and Middle Name come from 1st sql query and Last Name comes from 2nd sql query.
    I want to join the result obtained from both the sql queries in one Jasper Report (not as 2 separate sections but as one section).
    My problem is how to view my report in the web. furthermore, how to make complex query in jasperassistant, like multiple table in one query, because i�m integrating multiple query in one form or sheets of paper.
    Please help me in this.
    Thanks
    Sandeep
    Calance
    India

    Hi Sheldon,
    we never have issues when we combine standard objects, like a cliear with a load inforprovider, or the master data integration you mentioned in your document. However, from the moment we combine a script logic with a standard package (like a move) it does not work .The data package contains the task needed for the script and for the move. the process chain is called up but always comes in error in the first step (BPC modify dynamically ) ... there is also no log when checking the view status ...
    I can sent you some screenshots if you like ...
    D

Maybe you are looking for

  • Windows 8.0 use tutorials do not work.

    When I go to the tutorials for use of Windows 8.0 the tile shows up and I click on either the triangle in the middle of the tutorial or on the triangle at the beginning of the progress bar the selected tutorial switches back to the opening tiles scre

  • Can't Burn a .img file

    iDVD file plays fine on Mac. File is a video transferred from VHS to iMovie, then made into iDVD file, with added scrolling block comments and one picture. The burn process completes the "Processing" step, but gives a message and hangs up without bur

  • How do I send a dunning notice to the PAYER & NOT to ship-to-party?

    Hi All, Even if I dun the PAYER, the dunning notice is created for ship-to-party account specified in the sales order . Can I customise SAP to send dunning notices to PAYER and not to SHIP-TO-PARTY?

  • Airplay, Airport Express not working, 10.7.1 (Lion)

    Hi, Trying to connect to external speakers connected to airport express. I've done this successfully before but I've recently upgraded to Lion and now cannot connect: I see the airport express listed in itunes, but when I click it, it just sets back

  • Parallel Ledger resticting Entries of Settlement

    Hi Gurus In our project when we do CO Settlements system posts to FI Documents apart from CO Documents. FI Documents are posting to both 0L (leading Ledger) and LG Ledger(ParalleleLeder),the Client  requirement is they should not post for certain cou