Calling oracle API having parameter as record type throughPL/SQL WebService

Hi All,
I dont know whether this is the right forum to put this query, but as i am using a pl/sql web service , putting the query on this forum.
My requirement is to call oracle API which in turh creates a single Invoice(using Ar_Invoice_Api_Pub.create_single_invoice )
But the issue is this API in turn has some of the input parameters as Record type and table type, my concern is how to pass this data(record type or table type) as parameter thorugh java code .. If i use Collection or Hashmap will it work , I dont think so , some intermediate conversion will require.
Subsequently the other requirement is fetch this record/table type data and return it to the java code
Please correct me if i am wrong and suggest a proper solution if anybody is aware off or tried such things before.
Thanks in advance.
Regards,
Anant.

Hi,I'm new comer of this world,
I've a pl/sql like this:
package MY_WS_API is
type record_set is ref cursor;
PROCEDURE Get_User_Info(p_user_id VARCHAR2,
p_rep_id VARCHAR2,
p_flag out number,
p_msg out varchar2,
p_recordset out record_set);
end MY_WS_API;
when I using jdeveloper trying to publish it as a webservice, in the step 4 of the wizzard poping me choose the program unit to expose, the PROCEDURE Get_User_Info is not available and told me "Ref cursor Type is not supported due to a jdbc limitation and Ref Cursor Types are only supported for use of return type".
THE QUESTION is:
1.the cursor I used is of return type,I'm not very understanding the "why not" message upon.
2.in such case , need I trans the return cursor into Object[] if have to?
3.any other limitation for generating WS from PL/SQL using jdeveloper?
Thanks!

Similar Messages

  • DB  Adapter Calling DB Procedure that returns a Record Type

    I am trying to call a PL/SQL procedure that returns a Record Type and a VARCHAR2 and I'm getting this error:
    <Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>env:Server</faultcode>
    <faultstring>java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'MY_PROC.GET_ID' ORA-06550: line 1, column 7: PL/SQL: Statement ignored </faultstring> </Fault>
    Is there something different I need to do to handle the Record Type OUT parameter?
    Thanks.

    The adapter configuration wizard should take care of the Record Type for you. It should invoke JPublisher to create an equivalent Object type and a package containing a wrapper that will be called by the adapter runtime. The package also contains conversion functions for converting between your Record Type and the generated Object type. Maybe it would help if you posted the signature of your stored procedure (not the body).

  • How to call stored procedure having parameter as oracle type from java???

    Hello,
    I have created following type & stored procedure in oracle. How can i call this stored procedure from my java class?
    I want to pass 2d array to this procedure.
    CREATE OR REPLACE TYPE type_survey AS OBJECT ( emp_id number,emp_name varchar(100));
    CREATE OR REPLACE TYPE tbl_survey AS VARRAY(100) OF type_survey;
    CREATE OR REPLACE PROCEDURE INSERTEMP (pp in tbl_survey)
    IS
    BEGIN
    FOR I IN pp.FIRST .. pp.LAST
    LOOP
    INSERT INTO SURVEY (id) VALUES (pp(I).emp_id);
    END LOOP;
    END;
    /

    CREATE OR REPLACE TYPE type_survey AS OBJECT ( emp_id number,emp_name varchar(100));
    CREATE OR REPLACE TYPE tbl_survey AS VARRAY(100) OF type_survey;
    CREATE OR REPLACE PROCEDURE APP_DATA.INSERTEMP (pp in tbl_survey,result out varchar)
    IS
    BEGIN
    FOR I IN pp.FIRST .. pp.LAST
    LOOP
    INSERT INTO SURVEY (id) VALUES (pp(I).emp_id);
    END LOOP;
    result:='done';
    END;
    public static void passArray() throws SQLException
         Connection conn=null;
         try{
              conn=getOracleConnection();//this method returns connection object
         catch (Exception e)      
              e.printStackTrace();
         String[][] val=new String[2][2];
    *     val[0][0]="1";*
    *     val[0][1]="aaa";*
    *     val[1][0]="2";*
    *     val[1][0]="bbb";*
    StructDescriptor desc1=StructDescriptor.createDescriptor("TYPE_SURVEY",conn);
    STRUCT p1struct1 = new STRUCT(desc1,conn,_val_); *//showing error at this line*
    ArrayDescriptor arraydesc = ArrayDescriptor.createDescriptor("TBL_SURVEY",conn);
    ARRAY array = new ARRAY(arraydesc,conn,*p1struct1*);
    CallableStatement cstmt = conn.prepareCall("{ call INSERTEMP(?,?)}");
    cstmt.setObject(1,array);
    cstmt.registerOutParameter(2, OracleTypes.VARCHAR);
    cstmt.execute();
    String res=cstmt.getString(2);
    System.out.println(res);
    in the above java code, I have passed 2d array of string to STRUCT constructor and passed STRUCT object i.e. p1struct1  to ARRAY constructor. is it correct? that means @bottom line, I want to pass val array to my stored porcedure. How can i do this? above code is showing following error......
    Exception in thread "main" java.sql.SQLException: Fail to convert to internal representation: [Ljava.lang.String;@146c1d4
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.oracore.OracleTypeNUMBER.toNUMBER(OracleTypeNUMBER.java:540)
         at oracle.jdbc.oracore.OracleTypeNUMBER.toDatum(OracleTypeNUMBER.java:54)
         at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:717)
         at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:1375)
         at oracle.sql.STRUCT.<init>(STRUCT.java:159)
         at com.flologic.ArrayDemo.passArray(ArrayDemo.java:29)
         at com.flologic.ArrayDemo.main(ArrayDemo.java:57)

  • Calling Oracle API from controller

    Hi,
    I need to call a Public API from controller.
    API procedure is having 85 parameters,but only few are manadatory. can someone tell me whether i need to pass all the parameters with default values or null or is there anyway i can pass only required parameters.

    Hi,
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleTypes;
    You create a callable statement like,
    OracleCallableStatement callableStatement = null;
    String callStr = " BEGIN mypackage_pkg.add_ite, "+
    "(p_organization_id => :1, " +
    " p_batch_id => :2, " +
    " p_reason_code => :3, " +
    " x_msg_count => :4); "+
    " END; ";
    callableStatement = (OracleCallableStatement)getOADBTransaction().createCallableStatement(addWriteOffItem,1);
    //Set in and out variables like,
    callableStatement.setNUMBER(1, organizationId);
    callableStatement.setNUMBER(2, batchId);
    callableStatement.setString(3, reasonCode);
    callableStatement.registerOutParameter(4,OracleTypes.VARCHAR,255);
    //Then execute the stmt
    callableStatement.execute();
    resultMessage = (String)callableStatement.getString(4);
    The code should be inside the try catch block.
    Thanks,
    With regards,
    Kali.
    OSSI.

  • Error passing in RECORD type into API

    Gurus,
    Getting the following error when I try and pass a RECORD type into an API. Am I passing it in properly?
    Any help is appreciated.
    Thanks,
    -Scott
    Here's my error:
    fnd_descr_flex_col_usage_pkg.load_row
    ERROR at line 21:
    ORA-06550: line 21, column 4:
    PLS-00306: wrong number or types of arguments in call to 'LOAD_ROW'
    ORA-06550: line 21, column 4:
    PL/SQL: Statement ignored
    Here's my anon block:
    declare
    TYPE who_type IS RECORD
    created_by NUMBER,
    creation_date DATE,
    last_updated_by NUMBER,
    last_update_date DATE,
    last_update_login NUMBER
    v_who_type who_type;
    v_sysdate date;
    begin
    select sysdate
    into v_sysdate
    from dual;
    v_who_type.created_by := 0;
    v_who_type.creation_date := v_sysdate;
    v_who_type.last_updated_by := 0;
    v_who_type.last_update_date := v_sysdate;
    v_who_type.last_update_login := 0;
    fnd_descr_flex_col_usage_pkg.load_row
    (x_application_short_name => 'SPL',
    x_descriptive_flexfield_name => 'HR_LOCATIONS' ,
    x_descriptive_flex_context_cod => '441',
    x_application_column_name => 'ATTRIBUTE5',
    x_who                          =>  v_who_type,
    x_end_user_column_name => 'District',
    x_column_seq_num => 10,
    x_enabled_flag => 'Y',
    x_required_flag => 'N',
    x_security_enabled_flag => 'N',
    x_display_flag => 'Y',
    x_display_size => 50,
    x_maximum_description_len => 50,
    x_concatenation_description_le => 25,
    x_flex_value_set_name => '50 Characters',
    x_range_code => '',
    x_default_type => '',
    x_default_value => '',
    x_runtime_property_function => '',
    x_srw_param => '',
    x_form_left_prompt => 'District',
    x_form_above_prompt => 'District',
    x_description => '');
    ...

    I followed Tubby's advice and called the package to which the RECORD type was defined, however, I'm getting a "no data found" error in the called package. The purpose of "internally" definining the record type inside my Anon block was so that I could assign variables locally.
    Help from you gurus would be greatly appreciated!
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "APPS.FND_DESCR_FLEX_COL_USAGE_PKG", line 508
    ORA-06512: at line 21
    Please do not refer me to any more EBS forums or links.  This is a coding question, not an EBS question.
    For the guy who asked, here is the procedure definition:
    PROCEDURE load_row
    (x_application_short_name IN VARCHAR2,
    x_descriptive_flexfield_name IN VARCHAR2,
    x_descriptive_flex_context_cod IN VARCHAR2,
    x_application_column_name IN VARCHAR2,
    x_who IN fnd_flex_loader_apis.who_type,
    x_end_user_column_name IN VARCHAR2,
    x_column_seq_num IN NUMBER,
    x_enabled_flag IN VARCHAR2,
    x_required_flag IN VARCHAR2,
    x_security_enabled_flag IN VARCHAR2,
    x_display_flag IN VARCHAR2,
    x_display_size IN NUMBER,
    x_maximum_description_len IN NUMBER,
    x_concatenation_description_le IN NUMBER,
    x_flex_value_set_name IN VARCHAR2,
    x_range_code IN VARCHAR2,
    x_default_type IN VARCHAR2,
    x_default_value IN VARCHAR2,
    x_runtime_property_function IN VARCHAR2,
    x_srw_param IN VARCHAR2,
    x_form_left_prompt IN VARCHAR2,
    x_form_above_prompt IN VARCHAR2,
    x_description IN VARCHAR2)

  • Oracle Apps adopter - Record type

    Hi
    Trying to figure out how to pass XML data to Oracle Apps adopter that have record type.
    If you have came across with similar situation, appreciate your response.
    Thanks

    You can't just us and transformation/assign for this ?
    With xml-data i assume you just want to extract the data from let's say the input-variable of your process ?

  • PL/SQL Record Type and Toplink

    Can i call PL/SQL procedure having a parameter of record type in toplink. If yes, how it is possible?

    Hi,
    Record defines a representation of a database row as field=>value pairs.Whenever a query is exceuted the rows in the result set can be accessed thru RECORD interface.Can you be more elaborate on the question.
    Are you trying to access the result set obtained after executing the Stored Proc using Record interface or you want to pass the Record as input parameter to Stored proc?

  • Flat File with multiple record types (OWB 10.2.0.2)

    Hi!
    I`m using OWB 10.2.0.2 and I`m trying to load a flat file with multiple record types, using SQL LOADER.
    In the flat file editor in the Record tab, I`ve set the type values and the corresponding record names like this:
    Type Value Record Name
    ======== ===========
    T TRAILER
    0 DETAILS
    1 DETAILS
    2 DETAILS
    When using this flat file in a mapping to load the data in a staging table, the generated code looks like this:
    INTO TABLE TRAILER
    TRUNCATE
    REENABLE DISABLED_CONSTRAINTS
    WHEN (1:1) = 'T'
    INTO TABLE DETAILS
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    WHEN (1:1) = '0,1,2'
    The above clause (WHEN (1:1) = '0,1,2') is wrong as I expect one "INTO TABLE..." clause for each record type.
    Could this be a bug or am I doing something wrong?
    Thanks a lot for your help,
    Yorgos

    We`re using two target tables, one for the trailer record and the other for the details records.
    We are facing this problem from the moment we upgraded from OWB 10.1 to OWB 10.2.0.2, so we think it must be something with the way the sql loader code is generated in the new version.
    As our data sources are mainly flat files coming from mainframes, this is a huge problem for us. We even asked an expert in DW from Oracle to help us on this, but still haven`t found a solution.
    Is there any workaround for this or should we forget sql loader and go with an external tables + custom PL/SQL code solution?
    Your help is greatly appreciated Jean-Pierre.
    Regards,
    Yorgos

  • Help in using record type and object type

    Hi Experts,
    I am new to object types and record types.
    I want to return the output of this query using one OUT parameter
    from the procedure using RECORD type or OBJECT type.
    with out using refcursor.
    SELECT empno,ename,sal FROM emp WHERE deptno=30;
    Let us assume the query is returning 50 records.
    I want to send those 50 records to OUT parameter using record type or object type.
    Please provide the for the requirement code using RECORD TYPE and OBJECT TYPE separately.
    Your earliest response is appreciated.
    Thanks in advance.

    Hi All,
    I have tried this.But it ising not work
    CREATE OR REPLACE PACKAGE maultiplevalues_pkg
    IS
    TYPE t_record IS RECORD
    (empno emp.empno%TYPE,
    ename emp.ename%TYPE,
    sal emp.sal%TYPE);
    V_RECORD t_record;
    TYPE t_type IS TABLE OF V_RECORD%TYPE;
    PROCEDURE maultiplevalues_pROC(p_deptno IN emp.deptno%TYPE,
    dept_result OUT t_type);
    END;
    CREATE OR REPLACE PACKAGE body maultiplevalues_pkg
    IS
    PROCEDURE maultiplevalues_pROC(p_deptno IN emp.deptno%TYPE,
    dept_result OUT t_type)
    is
    begin
    dept_result :=t_type();
    for I in(
    select EMPNO,ENAME,SAL from EMP WHERE deptno=p_deptno
    LOOP
    dept_result.extend;
    dept_result(i).empno :=i.empno;
    dept_result(i).ename :=i.ename;
    dept_result(i).sal :=i.sal;
    END LOOP;
    END;
    END;
    Please help me OUT return multiple values through single OUT variable in a procedure.
    Thanks.

  • DB proc - do you need to create a table to pass a ref cursor record type?

    I want to pass a limited selection of columns from a large table through a DB procedure using a REF CURSOR, returning a table rowtype:
    CREATE OR REPLACE package XXVDF_XPOS_DS021_ITEMS AS
         TYPE XXVDF_XPOS_DS021_ITEM_ARRAY
         IS REF CURSOR
         return XXVDF_XPOS_DS021_ITEM_TABLE%ROWTYPE;
    Do I need to create this dummy table?
    I can't get a TYPE to work, where the type is an OBJECT with the desired columns in it.
    So a dummy empty table will sit in the database...
    Is there another way?
    thanks!

    You can use RECORD type declaration:
    SQL> declare
      2   type rec_type is record (
      3    ename emp.ename%type,
      4    sal emp.sal%type
      5   );
      6   type rc is ref cursor return rec_type;
      7   rc1 rc;
      8   rec1 rec_type;
      9  begin
    10   open rc1 for select ename, sal from emp;
    11   loop
    12    fetch rc1 into rec1;
    13    exit when rc1%notfound;
    14    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    15   end loop;
    16   close rc1;
    17  end;
    18  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300or use, for example, VIEW to declare rowtype:
    SQL> create view dummy_view as select ename, sal from emp;
    View created.
    SQL> declare
      2   type rc is ref cursor return dummy_view%rowtype;
      3   rc1 rc;
      4   rec1 dummy_view%rowtype;
      5  begin
      6   open rc1 for select ename, sal from emp;
      7   loop
      8    fetch rc1 into rec1;
      9    exit when rc1%notfound;
    10    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    11   end loop;
    12   close rc1;
    13  end;
    14  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300 Rgds.

  • Calling Oracle Stored proc with record type and table Type

    I have a oracle SP which takes record type and table Type which are used for order management.
    Is there anay way to populate parameters with these datatypes and call the stored procedure using ODP.NET?
    Please help.
    Thanks in advance

    Hi,
    ODP supports associative arrays and REF Cursors. There is no support for PLSQL table of records.
    Jenny

  • Pass a record type vaiable in out parameter of a function in a package

    Hi All,
    1.I have created a ecod inside a package.
    2.Then created a function which has a out parameter of the above record.
    3.Now package body i'm creating a dynamic cursor .
    4.My equirement is to fetch this dynamic cursor's value into the out parameter of the function.
    I have created the below code for 1,2 and 3 but not getting how to achive the point 4.
    create package pkg
    type t_rec is recod (id number,id_name varchar2(10));
    type t_data is table of t_rec index by binary_integer;
    act_data t_data;
    funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean;
    end pkg;
    create package body pkg
    funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean is
    p_cur sys_refcursor;
    l_text varchar2(100);
    begin
    -- As per my requirement i have built a dynamic l_text which contains where clause by taking dept and region values.In actual i have nearly 10 in paramaters with >which i'm building a dynamic where clause in l_text. So i'm using a ref cursor.
    open p_cur for 'select id,id_name from tab1'||l_text';
    fetch p_cur bulk collect into act_data;
    exception ....
    end pkg;Now as per the code snippet i could fetch all the rows returned by p_cur into act_data.
    But how i will pass it though out parameter in the function which i will use somewhere in front end to show data.
    Please help me in this.
    Thanks in advance.

    bp wrote:
    i need to create the where clause one the basis of the values of IN parameters.Sometimes i need to take count of the data on the basis of the IN parameters and if one of the conditions return value i will build where clause with those parameters.Please google and read up on the importance of creating shareable SQL - which needs to be done using bind variables.
    The ref cursor interface in PL/SQL only support a static/fixed number of bind variables. So if you want to create cursors with variable number of bind values, you need to use conditional processing. E.g.
    SQL> create or replace procedure EmpFilter( c OUT sys_refcursor, nameFilter varchar2, jobFilter varchar2 ) is
      2          sqlSelect       varchar2(32767);
      3  begin
      4          --// we pretend to built a dynamic SQL statement - so the table
      5          --// name and so on is "unknown"
      6          sqlSelect := 'select * from emp ';
      7          case
      8                  when nameFilter is null and jobFilter is null then
      9                          open c for sqlSelect;
    10
    11                  when nameFilter is null and jobFilter is not null then
    12                          sqlSelect := sqlSelect||'where job like :filter';
    13                          open c for sqlSelect  using jobFilter;
    14
    15                  when nameFilter is not null and jobFilter is null then
    16                          sqlSelect  := sqlSelect||'where ename like :filter';
    17                          open c for sqlSelect  using nameFilter;
    18
    19                  when  nameFilter is not null and jobFilter is not null then
    20                          sqlSelect  := sqlSelect||'where ename like :filter1 and job like :filter2';
    21                          open c for sqlSelect  using nameFilter, jobFilter;
    22
    23          end case;
    24
    25          DBMS_OUTPUT.put_line( 'Dynamic SQL: '||sqlSelect );
    26  end;
    27  /
    Procedure created.
    SQL>
    SQL>
    SQL> var c refcursor
    SQL> begin
      2          EmpFilter( :c, 'A%', null );
      3  end;
      4  /
    Dynamic SQL: select * from emp where ename like :filter
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7499 ALLEN      SALESMAN        7698 1981/02/20 00:00:00       1600        300         30
          7876 ADAMS      CLERK           7788 1987/05/23 00:00:00       1100                    20
    SQL>
    SQL> begin
      2          EmpFilter( :c, null, 'ANALYST' );
      3  end;
      4  /
    Dynamic SQL: select * from emp where job like :filter
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 1987/04/19 00:00:00       3000                    20
          7902 FORD       ANALYST         7566 1981/12/03 00:00:00       3000                    20
    SQL>And this approach is for external clients - where a Visual Basic or Java client program calls the database, executes the stored procedure, and receives a cursor handle in turn. And the client then fetches the output of this cursor and process it.
    There is no need to return a record type of any sorts. The client wants the cursor handle as that is the optimal and best interface for the client to receive database data.
    If the caller is not an external client, but another PL/SQL procedure, then this approach does not make much sense.
    It is important that you understand basic Oracle concepts and fundamentals. What a cursor is. What the best way is to process Oracle data. How to best use the basic features of Oracle. Without that basic understanding, you as good as a low hour Cessna pilot getting into an Airbus A400M - where the Cessna pilot would not even be able to start a single engine, never mind get the plane in the air.
    Likewise, without a basic understanding of Oracle cursors and fundamentals, you will be unable to code even a single line of sensible code. Not because you are a bad programmer. Even the best programmer in the world will be unable to write decent code, if the programmer has no idea how the environment works, what the concepts and fundamentals are. But it is fair to expect that a good programmer will no write such code, understand that there is a lack of knowledge, and address that accordingly.

  • Replicating a standard Oracle API giving PLS-00306: wrong number or types

    I have replicated standard Oracle API to customize it and call it from an external procedure.
    When I am calling the customized API, it is giving me '[Error] PLS-00306 (3484: 16): PLS-00306: wrong number or types of arguments in call to 'PICK_RELEASE'' error.
    I am pretty sure that I am passing proper parameter values to the customized API call.
    Is there any thing I am missing here or is there any restriction on package which is not letting me use the standard API?
    Thank you,

    996060 wrote:
    I have replicated standard Oracle API to customize it and call it from an external procedure.
    When I am calling the customized API, it is giving me '[Error] PLS-00306 (3484: 16): PLS-00306: wrong number or types of arguments in call to 'PICK_RELEASE'' error.
    I am pretty sure that I am passing proper parameter values to the customized API call.
    Is there any thing I am missing here or is there any restriction on package which is not letting me use the standard API?
    Thank you,Have you reviewed the suggested solutions in (OERR: PLS-306 wrong number or types of arguments in call to '%s' [ID 27323.1])?
    Thanks,
    Hussein

  • Need help for SQL SELECT query to fetch XML records from Oracle tables having CLOB field

    Hello,
    I have a scenario wherein i need to fetch records from several oracle tables having CLOB fields(which is holding XML) and then merge them logically to form a hierarchy XML. All these tables are related with PK-FK relationship. This XML hierarchy is having 'OP' as top-most root node and ‘DE’ as it’s bottom-most node with One-To-Many relationship. Hence, Each OP can have multiple GM, Each GM can have multiple DM and so on.
    Table structures are mentioned below:
    OP:
    Name                             Null                    Type        
    OP_NBR                    NOT NULL      NUMBER(4)    (Primary Key)
    OP_DESC                                        VARCHAR2(50)
    OP_PAYLOD_XML                           CLOB       
    GM:
    Name                          Null                   Type        
    GM_NBR                  NOT NULL       NUMBER(4)    (Primary Key)
    GM_DESC                                       VARCHAR2(40)
    OP_NBR               NOT NULL          NUMBER(4)    (Foreign Key)
    GM_PAYLOD_XML                          CLOB   
    DM:
    Name                          Null                    Type        
    DM_NBR                  NOT NULL         NUMBER(4)    (Primary Key)
    DM_DESC                                         VARCHAR2(40)
    GM_NBR                  NOT NULL         NUMBER(4)    (Foreign Key)
    DM_PAYLOD_XML                            CLOB       
    DE:
    Name                          Null                    Type        
    DE_NBR                     NOT NULL           NUMBER(4)    (Primary Key)
    DE_DESC                   NOT NULL           VARCHAR2(40)
    DM_NBR                    NOT NULL           NUMBER(4)    (Foreign Key)
    DE_PAYLOD_XML                                CLOB    
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    SELECT
    j.op_nbr||'||'||j.op_desc||'||'||j.op_paylod_xml AS op_paylod_xml,
    i.gm_nbr||'||'||i.gm_desc||'||'||i.gm_paylod_xml AS gm_paylod_xml,
    h.dm_nbr||'||'||h.dm_desc||'||'||h.dm_paylod_xml AS dm_paylod_xml,
    g.de_nbr||'||'||g.de_desc||'||'||g.de_paylod_xml AS de_paylod_xml,
    FROM
    DE g, DM h, GM i, OP j
    WHERE
    h.dm_nbr = g.dm_nbr(+) and
    i.gm_nbr = h.gm_nbr(+) and
    j.op_nbr = i.op_nbr(+)
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    I am using above SQL select statement for fetching the XML records and this gives me all related xmls for each entity in a single record(OP, GM, DM. DE). Output of this SQL query is as below:
    Current O/P:
    <resultSet>
         <Record1>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <DM_PAYLOD_XML1>
              <DE_PAYLOD_XML1>
         </Record1>
         <Record2>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML2>
              <DM_PAYLOD_XML2>
              <DE_PAYLOD_XML2>
         </Record2>
         <RecordN>
              <OP_PAYLOD_XMLN>
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XMLN>
         </RecordN>
    </resultSet>
    Now i want to change my SQL query so that i get following output structure:
    <resultSet>
         <Record>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <GM_PAYLOD_XML2> .......
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XML1>
              <DM_PAYLOD_XML2> .......
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XML1>
              <DE_PAYLOD_XML2> .......
              <DE_PAYLOD_XMLN>
         </Record>
         <Record>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML1'>
              <GM_PAYLOD_XML2'> .......
              <GM_PAYLOD_XMLN'>
              <DM_PAYLOD_XML1'>
              <DM_PAYLOD_XML2'> .......
              <DM_PAYLOD_XMLN'>
              <DE_PAYLOD_XML1'>
              <DE_PAYLOD_XML2'> .......
              <DE_PAYLOD_XMLN'>
         </Record>
    <resultSet>
    Appreciate your help in this regard!

    Hi,
    A few questions :
    How's your first query supposed to give you an XML output like you show ?
    Is there something you're not telling us?
    What's the content of, for example, <OP_PAYLOD_XML1> ?
    I don't think it's a good idea to embed the node level in the tag name, it would make much sense to expose that as an attribute.
    What's the db version BTW?

  • Passing Record type parameter from one session to other session

    Hi,
    I have a package.procedure, in that I am calling custom workflow, inside this workflow again I am calling
    same package.procedure (Its an recursive call)
    I need to pass record type parameter in this package.procedure.
    I tried with global variables but Workflow starts its new session so it losses all variables.
    Now I am going with creation of Custom table.
    Please advice, is there any way other than creation of Custom table.
    I mean can we pass Record type parameter from one session to other session without creating table.
    Regards
    Rohit

    Al-Salamu Alikum We Rahmatu Allah We Barakatu...
    want this place from to be passed as a parameter to the shipping bill form..... using web.show_documentwhy don't u think of just passing data parameter or global parameters from one form to another
    Pass global variable between two forms.
    Hope this helps...
    Regards,
    Abdetu...

Maybe you are looking for

  • No Nano - does not show up in ITunes or MY Computer

    I'm new to the IPOD and have had the Nano 1 week of which I spent 6 days trying to figure out why it wouldn't show up in ITunes. Solution - Eliminated extra drive assignments. I had used all the drive letter assignments from E: up to T: and had to re

  • Pass data via hyperlink

    Can a Flex app read a variable passed to it through a hyperlink? I am trying to create a chart page that reads its data from XML pages (using HTTPService). I want to have the chart page determine which of several XML pages to use for data based on th

  • How to set applications for automatic updates?

    Some apps are updated automatically and others require approval before the update takes place. Is there a way to change an installed app from the approval-needed mode to automatic updates?

  • IMovie 5.0.2 Technique Questions

    Coupla questions, being new to iMovie... 1. Is there a way to move an audio track from trk. 2 to trk. 3 and prevent it from shifting horizontally during the shift? Or do I just have to be really really really really really really incredibly super ext

  • Using power button to turn off computer will it damage it

    My laptop freezes restart and have been told to hold down power button for 10 seconds to shut it down. Restarts with no issues but would like to know if in the future it will damage it if it keeps happening.