Retrieve xml data from a relational table(oracle) with datatype as xmltyp

Hello Avijit, any resolution for this issue?

hi .... I am trying to retrieve xml data from a relational table with datatype as xmltyp. The SQ is retrieving rows but the xml parser give transformation error . The transformation retrieve xml data from a relational table(oracle) with datatype as xmltyp returned a row error status on receiving an input row on group retrieve xml data from a relational table(oracle) with datatype as xmltyp.  ERROR : An XML document was truncated and thus not processed. Input row from SQ_XMLTYPE_TEST: Rowdata: ( RowType=0(insert) Src Rowid=5 Targ Rowid=5 DOCUMENT (DataInput:Char.64000:): "<?xml version='1.0' encoding='UTF-8'?><main><DATA_RECORD> <OFFER_ID>434345</OFFER_ID> <ADDR>sec -2 salt lake</ADDR> <CITY>kolkata</CITY> (DISPLAY TRUNCATED)(TRUNCATED)" )  thanks in advance Avijit

Similar Messages

  • Querying XML data in  Object Relational tables

    Hi,
    Can someone help me?
    I have registered the purchaseorder.xsd in my database schema.
    [ http://www.oracle.com/technology/oramag/oracle/03-jul/o43xml.html ]
    declare
    l_bfile bfile;
    begin
    l_bfile := bfilename(
    'XMLSAMP', 'purchaseOrder.xsd');
    dbms_lob.open(l_bfile);
    dbms_xmlschema.registerschema('http://localhost:8080/purchaseOrder.xsd', l_bfile);
    dbms_lob.close(l_bfile);
    end;
    This has created a table "PURCHASEORDER"
    SYS_NC_ROWINFO$ SYS.XMLTYPE
    It has also created object types.
    select object_name from user_objects where object_type = 'TYPE' and object_name like 'XDBPO%'
    XDBPO_ACTIONS_TYPE
    XDBPO_ACTION_COLLECTION
    XDBPO_ACTION_TYPE
    XDBPO_LINEITEMS_TYPE
    XDBPO_LINEITEM_TYPE
    XDBPO_PART_TYPE
    XDBPO_REJECTION_TYPE
    XDBPO_SHIPINSTRUCTIONS_TYPE
    XDBPO_TYPE
    I have also inserted an xml into that table.
    INSERT INTO "PURCHASEORDER"
    VALUES
    xmltype
    getFileContent('ADAMS-20011127121040988PST.xml','XMLSAMP')
    Now how do I retrieve the data from this table and the other object types?
    Is extractvalue the only method? I have gone thru examples in the net but everything uses the element names in xml document and not the object type names.
    For example to retreive the lineitem details, this query can be used
    SELECT extractValue(value(d),'/Description')
    FROM "PURCHASEORDER" p,
    table (xmlsequence(extract(p.SYS_NC_ROWINFO$,'/PurchaseOrder/LineItems/LineItem/Description'))) d
    But I want to retreive it from "XDBPO_LINEITEM_TYPE".
    Is this possible?
    Can someone help me please?
    Thanks in advance.
    Jay

    #1. If you had taken the time to read some of the other posts in the forum all of the answers you needed were all there..
    #2. As PM's we are not expected to spend a lot of time dealing with the forums. In general we are expected only to step in and answer the questions that are not easily answered by carefully reading existing posts or deal with cases were the wrong answer is supplied.
    #3. I'm technically on vacation, and posted to that effect last week, so pushing for an answer is not at all appreciated...
    #4. The problem is extremely simple, at least as stated in your simple example.
    Given the schema.. Note It's been annotated
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="Bill">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="InvCtlN"/>
                        <xs:element ref="MedBU"/>
                        <xs:element ref="Lineitem" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="InvCtlN">
              <xs:simpleType>
                   <xs:restriction base="xs:byte">
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="LineCode">
              <xs:simpleType>
                   <xs:restriction base="xs:int">
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="Lineitem">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Type"/>
                        <xs:element ref="LineCode"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="MedBU">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="SampleFile" xdb:defaultTable="SAMPLE_FILE_TABLE">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Bill" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Type">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
    </xs:schema>and the following instance
    <SampleFile xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="testcase.xsd">
         <Bill>
              <InvCtlN>1</InvCtlN>
              <MedBU>ABC</MedBU>
              <Lineitem>
                   <Type>P1</Type>
                   <LineCode>99214</LineCode>
              </Lineitem>
         </Bill>
         <Bill>
              <InvCtlN>2</InvCtlN>
              <MedBU>DEF</MedBU>
              <Lineitem>
                   <Type>P2</Type>
                   <LineCode>99215</LineCode>
              </Lineitem>
              <Lineitem>
                   <Type>P3</Type>
                   <LineCode>99216</LineCode>
              </Lineitem>
         </Bill>
         <Bill>
              <InvCtlN>3</InvCtlN>
              <MedBU>HJK</MedBU>
              <Lineitem>
                   <Type>P4</Type>
                   <LineCode>99217</LineCode>
              </Lineitem>
         </Bill>
    </SampleFile>The following appears to be what you are looking for
    SQL*Plus: Release 10.2.0.2.0 - Production on Mon Feb 20 22:42:53 2006
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    SQL> spool registerSchema_&4..log
    SQL> set trimspool on
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> declare
      2    result boolean;
      3  begin
      4    result := dbms_xdb.createResource('/home/&1/xsd/&4',
      5                                      bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
      6  end;
      7  /
    old   4:   result := dbms_xdb.createResource('/home/&1/xsd/&4',
    new   4:   result := dbms_xdb.createResource('/home/OTNTEST/xsd/testcase.xsd',
    old   5:                                    bfilename(USER,'&4'),nls_charset_id('AL32UTF8'));
    new   5:                                    bfilename(USER,'testcase.xsd'),nls_charset_id('AL32UTF8'));
    PL/SQL procedure successfully completed.
    SQL> commit
      2  /
    Commit complete.
    SQL> alter session set events='31098 trace name context forever'
      2  /
    Session altered.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      schemaURL => '&3',
      5      schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
      6      local     => TRUE,
      7      genTypes  => TRUE,
      8      genBean   => FALSE,
      9      genTables => &5
    10    );
    11  end;
    12  /
    old   4:     schemaURL => '&3',
    new   4:     schemaURL => 'testcase.xsd',
    old   5:     schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
    new   5:     schemaDoc => xdbURIType('/home/OTNTEST/xsd/testcase.xsd').getClob(),
    old   9:     genTables => &5
    new   9:     genTables => TRUE
    PL/SQL procedure successfully completed.
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL*Plus: Release 10.2.0.2.0 - Production on Mon Feb 20 22:42:55 2006
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    SQL> spool insertFile_&3..log
    SQL> set trimspool on
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> set timing on
    SQL> set long 10000
    SQL> --
    SQL> insert into &4 values (xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
      2  /
    old   1: insert into &4 values (xmltype(bfilename(USER,'&3'),nls_charset_id('AL32UTF8')))
    new   1: insert into SAMPLE_FILE_TABLE values (xmltype(bfilename(USER,'testcase.xml'),nls_charset_id('AL32UTF8')
    1 row created.
    Elapsed: 00:00:00.06
    SQL> commit
      2  /
    Commit complete.
    Elapsed: 00:00:00.00
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL*Plus: Release 10.2.0.2.0 - Production on Mon Feb 20 22:42:55 2006
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    SQL> spool testcase.log
    SQL> --
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> --
    SQL> -- Testcase code here
    SQL> --
    SQL> set trimspool on
    SQL> set autotrace on explain
    SQL> set timing on
    SQL> set pages 10 lines 160 long 100000
    SQL> --
    SQL> column INVCTLN format  9999
    SQL> column MEDBU   format  A10
    SQL> column TYPE    format  A10
    SQL> column LINECODE format 999999999
    SQL> create or replace view MASTER_TABLE_VIEW
      2  (
      3     INVCTLN,
      4     MEDBU
      5  )
      6  as
      7  select extractValue(value(bill),'/Bill/InvCtlN'),
      8         extractValue(value(bill),'/Bill/MedBU')
      9    from SAMPLE_FILE_TABLE t,
    10         table(xmlsequence(extract(value(t),'/SampleFile/Bill'))) Bill
    11  /
    View created.
    Elapsed: 00:00:00.04
    SQL> create or replace view DETAIL_TABLE_VIEW
      2  (
      3     INVCTLN,
      4     TYPE,
      5     LINECODE
      6  )
      7  as
      8  select extractValue(value(bill),'/Bill/InvCtlN'),
      9         extractValue(value(LineItem),'/Lineitem/Type'),
    10         extractValue(value(LineItem),'/Lineitem/LineCode')
    11    from SAMPLE_FILE_TABLE t,
    12         table(xmlsequence(extract(value(t),'/SampleFile/Bill'))) Bill,
    13         table(xmlsequence(extract(value(bill),'/Bill/Lineitem'))) LineItem
    14  /
    View created.
    Elapsed: 00:00:00.05
    SQL> set autotrace on explain
    SQL> --
    SQL> select * from MASTER_TABLE_VIEW
      2  /
    INVCTLN MEDBU
          1 ABC
          2 DEF
          3 HJK
    Elapsed: 00:00:00.05
    Execution Plan
    Plan hash value: 2362844891
    | Id  | Operation          | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |                    |     3 |  6165 |   805   (1)| 00:00:10 |
    |   1 |  NESTED LOOPS      |                    |     3 |  6165 |   805   (1)| 00:00:10 |
    |*  2 |   TABLE ACCESS FULL| SAMPLE_FILE_TABLE  |     1 |    30 |     3   (0)| 00:00:01 |
    |*  3 |   INDEX RANGE SCAN | SYS_IOT_TOP_159053 |     3 |  6075 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
                  xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
                  http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><rea
                  d-properties/><read-contents/></privilege>'))=1)
       3 - access("NESTED_TABLE_ID"="SAMPLE_FILE_TABLE"."SYS_NC0000800009$")
    Note
       - dynamic sampling used for this statement
    SQL> select * from DETAIL_TABLE_VIEW
      2  /
    INVCTLN TYPE         LINECODE
          1 P1              99214
          3 P4              99217
          2 P2              99215
          2 P3              99216
    Elapsed: 00:00:00.07
    Execution Plan
    Plan hash value: 971642473
    | Id  | Operation               | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT        |                    |     4 |  8352 |   813   (0)| 00:00:10 |
    |   1 |  NESTED LOOPS           |                    |     4 |  8352 |   813   (0)| 00:00:10 |
    |   2 |   MERGE JOIN CARTESIAN  |                    |     4 |  8220 |   805   (0)| 00:00:10 |
    |*  3 |    TABLE ACCESS FULL    | SAMPLE_FILE_TABLE  |     1 |    30 |     3   (0)| 00:00:01 |
    |   4 |    BUFFER SORT          |                    |     4 |  8100 |   802   (0)| 00:00:10 |
    |   5 |     INDEX FAST FULL SCAN| SYS_IOT_TOP_159055 |     4 |  8100 |   802   (0)| 00:00:10 |
    |*  6 |   INDEX UNIQUE SCAN     | SYS_IOT_TOP_159053 |     1 |    33 |     2   (0)| 00:00:01 |
    |*  7 |    INDEX RANGE SCAN     | SYS_C0022871       |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - filter(SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
                  xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
                  http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-pro
                  perties/><read-contents/></privilege>'))=1)
       6 - access("NESTED_TABLE_ID"="SYS_NTh/v83GzKQ1evte63P5QRog=="."SYS_NC0000700008$")
           filter("NESTED_TABLE_ID"="SAMPLE_FILE_TABLE"."SYS_NC0000800009$")
       7 - access("NESTED_TABLE_ID"="SYS_NTh/v83GzKQ1evte63P5QRog=="."SYS_NC0000700008$")
    Note
       - dynamic sampling used for this statement
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    C:\xdb\otn\362337>

  • PROBLEM IN EXPORTING DATA FROM A RELATIONAL TABLE TO ANOTHER RELATIONAL TAB

    Hi,
    While trying to export data from a source table to a target table, problem occurs with loading the data in the work table(SrcSet0)[As shown in the operator]. The Work Table has been dropped and created successfully, the problem is coming with loading the data( in this work table(SrcSet0)). The error details as mentioned below. Please advise:-
    ODI-1227: Task SrcSet0 (Loading) fails on the source ORACLE connection ORACLE_SOURCE.
    Caused By: java.sql.SQLException: SQL string is not Query
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1442)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
         at oracle.odi.query.JDBCTemplate.executeQuery(JDBCTemplate.java:189)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:89)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
         at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:67)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:662)
    Thanks
    Anindya

    Hi actdi,
    This is my KM_IKM SQL Incremental Update.xml code:-
    and I have find it(for (int i=odiRef.getDataSetMin(); i <= odiRef.getDataSetMax(); i++)) and high lighted it(Bold Text).
    So, please advise.
    Here is the main part of this code because the code is too long to post.It exceeds maxlength for the msg.
    So here it is:
    <Object class="com.sunopsis.dwg.dbobj.SnpTxtHeader">
    <Field name="Enc" type="java.lang.String">null</Field>
    <Field name="EncKey" type="java.lang.String">null</Field>
    <Field name="ITxt" type="com.sunopsis.sql.DbInt"><![CDATA[1695003]]></Field>
    <Field name="ITxtOrig" type="com.sunopsis.sql.DbInt"><![CDATA[102]]></Field>
    <Field name="SqlIndGrp" type="java.lang.String"><![CDATA[2]]></Field>
    <Field name="Txt" type="java.lang.String"><![CDATA[insert into <%=odiRef.getTable("L","INT_NAME","A")%>
    <%=odiRef.getColList("", "[COL_NAME]", ",\n\t", "", "(((INS or UPD) and !TRG) and REW)")%>,
    IND_UPDATE
    *<%for (int i=odiRef.getDataSetMin(); i <= odiRef.getDataSetMax(); i++){%>*
    <%=odiRef.getDataSet(i, "Operator")%>
    select <%=odiRef.getPop("DISTINCT_ROWS")%>
    <%=odiRef.getColList(i,"", "[EXPRESSION]", ",\n\t", "", "(((INS or UPD) and !TRG) and REW)")%>,
    <% if (odiRef.getDataSet(i, "HAS_JRN").equals("1")) { %>
    JRN_FLAG IND_UPDATE
    <%} else {%>
    'I' IND_UPDATE
    <%}%>
    from <%=odiRef.getFrom(i)%>
    where (1=1)
    <%=odiRef.getJoin(i)%>
    <%=odiRef.getFilter(i)%>
    <%=odiRef.getJrnFilter(i)%>
    <%=odiRef.getGrpBy(i)%>
    <%=odiRef.getHaving(i)%>
    <%}%>
    ]]></Field>
    </Object>
    <Object class="com.sunopsis.dwg.dbobj.SnpLineTrt">
    <Field name="AlwaysExe" type="java.lang.String"><![CDATA[0]]></Field>

  • Retrieving data from a relational table and CLOB as a whole XML file

    I created the table lob_example and I have managed to insert XML document into it using XML SQL Utility. In this document I put contents of <DESCRIPTION> tag into CDATA section.
    LOB_EXAMPLE
    Name Null? Type
    ID NOT NULL NUMBER
    DESCRIPTION CLOB
    NAME VARCHAR2(40)
    But I could not retrieve this data properly. I can think of only one solution - to parse and build the whole XMLDocument. I found the suggestion of another solution to use Oracle8i views to do that in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm, but this text is not clear enough for me.
    I would like to quote the fragment from document mentioned above, which is ambiguous for me:
    "Combining XML Documents and Data Using Views
    Finally, if you have a combination of structured and unstructured XML data, but still want to view and operate on it as a whole, you can use Oracle8i views. Views enable you to construct an object on the "fly" by combining XML data stored in a variety of ways. So, you can store structured data (such as employee data, customer data, and so on) in one location within object -relational tables, and store related unstructured data (such as descriptions and comments) within a CLOB. When you need to retrieve the data as a whole, you simply construct the structure from the various pieces of data with the use of type constructors in the view's select statement. The XML SQL Utility then enables retrieving the constructed data from the view as a single XML document."
    The main question is - how to use type constructors in the view's select statement?

    Hello
    Sorry for asking the same question again, but any responses would be greatly appreciated.
    How to use type constructors in the view's select statement?
    I could not find any answers for this question on Technet. Maybe the other approaches are more efficient to combine the part of data from CLOB with data from other column types?
    Thank you

  • Capture XML data payload into database table (Oracle EBS R12)

    Hi All,
    We have a XML Publisher report which generates output in PDF format. We want to capture the XML data payload generated by this report and put it into a DB table once the PDF is generated.
    This report is generated through Oracle EBS R12 and XML Payload is stored by oracle by default in $APPLCSF/out directory.
    Any pointers would be helpful
    br

    Couple of options, this one is probably the easiest without knowing other requirements (e.g., do you have to store the output as XML, or do you just the data available so you can output in XML later?).
    Capture the SQL statement that generates the output in the first place. If you have that statement, you can insert into some table using the select statement. Once you have the report data (and you can tag that particular set of data with a job ID, timestamp, whatever, in case you need to store it and distinguish it from other reports down the road), you can generate XML output using the PL/SQL built-in DBMS_XMLGEN.
    Is that what you are looking for?

  • Help for retrieve xml data from database.

    Hello friends,
    I am inserting xml file into oracle database.
    column name is xyz_xml and data type is XMLType.
    I have successfully inserted that.
    But My problem is How can i retrieve that xml file from database and can view in explorer as a text.
    If any one have any idea than let me know.
    Thanks

    Hello Friend...!
    I am getting the following error and i am not figure out this error :
    NosuchfieldException : conversionPlease Help me.

  • How to retrieve the data from MDM hierarchy table using MDM Java API

    Hi,
    I had a hierarchy table in MDM. This table had some column say x. I want to retrieve the values of this x column and need to show them in a drop down using MDM Java API.
    Can anyone help me to solve this?
    Regards
    Vallabhaneni

    Hi,
    Here is your code...
    TableId Hier_TId = repository_schema.getTableId(<hierarchy table id>);
    java.util.List list = new ArrayList();
    ResultDefinition Supporting_result_dfn = null;
    FieldProperties[] Hier_Field_props =rep_schema.getTableSchema(Hier_TId).getFields();
    LookupFieldProperties lookup_field = null;
    TableSchema lookupTableSchema = null;
    FieldId[] lookupFieldIDs = null;
    for (int i = 0, j = Hier_Field_props.length; i < j; i++) {
    if (Hier_Field_props<i>.isLookup()) {     
                                  lookup_field = (LookupFieldProperties) Hier_Field_props<i>;
         lookupTableSchema =repository_schema.getTableSchema(lookup_field.getLookupTableId());
                                  lookupFieldIDs = lookupTableSchema.getFieldIds();
         Supporting_result_dfn = new ResultDefinition(lookup_field.getLookupTableId());
         Supporting_result_dfn.setSelectFields(lookupFieldIDs);
         list.add(Supporting_result_dfn);
    com.sap.mdm.search.Search hier_search =new com.sap.mdm.search.Search(Hier_TId);
    ResultDefinition Hier_Resultdfn =     new ResultDefinition(Hier_TId);
    Hier_Resultdfn.setSelectFields(rep_schema.getTableSchema(Hier_TId).getDisplayFieldIds());
    ResultDefinition[] supportingResultDefinitions =
    (ResultDefinition[])list.toArray(new ResultDefinition [ list.size() ]);
    RetrieveLimitedHierTreeCommand retrieve_Hier_tree_cmd =
    new RetrieveLimitedHierTreeCommand(conn_acc);
    retrieve_Hier_tree_cmd.setResultDefinition(Hier_Resultdfn);
    retrieve_Hier_tree_cmd.setSession(Auth_User_session_cmd.getSession());
    retrieve_Hier_tree_cmd.setSearch(hier_search);
    retrieve_Hier_tree_cmd.setSupportingResultDefinitions(supportingResultDefinitions);
    try {
         retrieve_Hier_tree_cmd.execute();
    } catch (CommandException e5) {
              // TODO Auto-generated catch block
              e5.printStackTrace();
    HierNode Hier_Node = retrieve_Hier_tree_cmd.getTree();
    print(Hier_Node,1);
    //method print()
    static private void print(HierNode node, int level) {
    if (!node.isRoot()) {
         for (int i = 0, j = level; i < j; i++) {
              System.out.print("\t");
         System.out.println(node.getDisplayValue());
    HierNode[] children = node.getChildren();
    if (children != null) {
              level++;
    for (int i = 0, j = children.length; i < j; i++) {
    print(children<i>, level);
    //end method print()
    Best regards,
    Arun prabhu S
    Edited by: Arun Prabhu Sivakumar on Jul 7, 2008 12:19 PM

  • Select data from an XML Column in a Relational Table

    Hi guys,
    I read a lot of documentation from Oracle how to select xml nodes from an XML Table. The following statement works perfectly for an XML table.
    select extract(OBJECT_VALUE, '/loop/loop_data/description') "DESCRIPTION"
    from loop_table
    where xmlexists('/loop/loop_data[type_code="212"]' PASSING OBJECT_VALUE);
    BUT: how to select xml nodes (data) from a relational table with an XML column???
    I'm interested in the xml data.
    Thanks!
    Miro

    I've tried the same but i don't get any results
    WITH BOL_JMS_MESSAGES_TMP AS
    (SELECT 1 pk,
    XMLTYPE('<MESSAGE_ENVELOPE>
    <ORDER>
    <DIRECT_TURNOVER>N</DIRECT_TURNOVER>
    <DATE_PLACED>2010-05-06T17:14:35.189+02:00</DATE_PLACED>
    <PAYMENT_TYPE>02</PAYMENT_TYPE>
    <ACCOUNT_NUMBER>108317412</ACCOUNT_NUMBER>
    <GIFT_FLAG>N</GIFT_FLAG>
    <ID>7788783900</ID>
    <NETPRICE>117.21</NETPRICE>
    <VAT>7.69</VAT>
    <TOTALPRICE>126.85</TOTALPRICE>
    <SHIPHAND_COSTS>1.64</SHIPHAND_COSTS>
    <SHIPHAND_VAT>0.31</SHIPHAND_VAT>
    <SHIPEQUALBILL_FLAG>Y</SHIPEQUALBILL_FLAG>
    <SHIPPING_METHOD>01</SHIPPING_METHOD>
    </ORDER>
    </MESSAGE_ENVELOPE>') rnd_col
    from dual
    select extract(rnd_col, '/message_envelope/order/direct_turnover/date_placed/payment_type/account_number/gift_flag/id/netprice/vat/totalprice/shiphand_costs/shiphand_vat/shipequalbill_flag/SHIPPING_METHOD') "Payment type"
    FROM BOL_JMS_MESSAGES_TMP
    WHERE existsNode(rnd_col,'/message_envelope') = 1;
    No rows.
    Eventually i want to update the payment type from 02 to 00.

  • Retrieve data from a large table from ORACLE 10g

    I am working with a Microsoft Visual Studio Project that requires to retrieve data from a large table from Oracle 10g database and export the data into the hard drive.
    The problem here is that I am not able to connect to the database directly because of license issue but I can use a third party API to retrieve data from the database. This API has sufficient previllege/license permission on to the database to perform retrieval of data. So, I am not able to use DTS/SSIS or other tool to import data from the database directly connecting to it.
    Here my approach is...first retrieve the data using the API into a .net DataTable and then dump the records from it into the hard drive in a specific format (might be in Excel file/ another SQL server database).
    When I try to retrieve the data from a large table having over 13 lacs records (3-4 GB) in a data table using the visual studio project, I get an Out of memory exception.
    But is there any better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?
    Any help on this problem will be highly appriciated.
    Thanks in advance...
    -Jahedur Rahman
    Edited by: Jahedur on May 16, 2010 11:42 PM

    Girish...Thanks for your reply...But I am sorry for the confusions. Let me explain that...
    1."export the data into another media into the hard drive."
    What does it mean by this line i.e. another media into hard drive???
    ANS: Sorry...I just want to write the data in a file or in a table in SQL server database.
    2."I am not able to connect to the database directly because of license issue"
    huh?? I never heard this question that a user is not able to connect the db because of license. What error / message you are getting?
    ANS: My company uses a 3rd party application that uses ORACLE 10g. And my compnay is licensed to use the 3rd party application (APP+Database is a package) and did not purchased ORACLE license to use directly. So I will not connect to the database directly.
    3.I am not sure which API is you are talking about, but i am running an application of the visual studio data grid or similar kind of controls; in which i can select (select query) as many rows as i needed; no issue.
    ANS: This API is provided by the 3rd party application vendor. I can pass a query to it and it returns a datatable.
    4."better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?"
    ANS: As I get a system error (out of memory) when I select all rows in a datatable at a time, I wanted to retrieve the data in multiple phases.
    E.g: 1 to 20,000 records in 1st phase
    20,001 to 40,000 records in 2nd phase
    40,001 to ...... records in 3nd phase
    and so on...
    Please let me know if this does not clarify your confusions... :)
    Thanks...
    -Jahedur Rahman
    Edited by: user13114507 on May 12, 2010 11:28 PM

  • Show data from sql server to oracle db

    Hi,
    I am using oracle 10g R1 on windows 2003 platform. On one machine database 10gR1 is running and on other machine sql server is running. I want to retrieve some data from sql server to oracle database. Please tell me how I can show data from sql server to oracle db.
    Thanks

    To make heterogeneous connection with oracle:
    1.First make an ODBC connection, make entry in System DSN(to create a data source)
    2.Make an entry in tnsnames.ora
    3.Make an entry in listener.ora under SID_LIST_LISTENER
    4.Make an entry in file named init<HS>.ora file located "oracle_base\oracle_home\db\hs\admin"
    5.Restart the listener
    e.g:
    1. create a odbc system dsn named like 'sqlserver'
    2. sqlserver= (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp) (HOST=xx.xx.xx.xx) (PORT=1521))
    (CONNECT_DATA = (SERVICE_NAME=sqlserver))
    (HS = OK)
    3. (SID_DESC = (SID_NAME = sqlserver) (ORACLE_HOME = oracle_base\oracle_home\db) (PROGRAM = hsodbc) )
    4.Create a file named initsqlserver.ora and make the following entry:
    HS_FDS_CONNECT_INFO = sqlserver
    Alternatively, you can copy the file named inithsodbc.ora and rename it to initsqlserver.ora
    and edit as HS_FDS_CONNECT_INFO = sqlserver
    5. lsnrctl reload listener_name
    regards
    adnan kaysar

  • Unable to retrieve data from a nested table in Oracle 8i from JSP

    How do i retrieve data from a nested table in Oracle 8i from my JSP code?
    When i try to execute the query , a general error is thrown.
    Kindly advice as soon as possible.

    How do i retrieve data from a nested table in Oracle 8i from my JSP code?
    When i try to execute the query , a general error is thrown.
    Kindly advice as soon as possible.

  • Retrieve data from a synonym in oracle database through db connect

    Hi Everyone,
    I have created certain synonym for some tables in oracle. I want to retrieve data from it through db connect but where through source system and then selecting database tables, only tables and views are available.
    Synonyms are not available to create data sources and retrieve the data from it. Why is it so. Is this a limitation of db connect.
    Can anyone please let me know about it.
    Thanks,
    Joshua.

    Hi,
    You want to import data from an external Oracle database into your BW 3.X. To do this, you can connect the external database to the BW 3.X release as a source system using the external database connect. BW 3.X here represents BW 3.0, BW 3.1 and BW 3.5 because in other (DB relevant) parts, all 3 versions are based on the same source code.
    General information
    The above function allows you to load data from an external Oracle database (not a BW database) into your BW 3.0 system.
    There may also be constellations which cannot be used directly through the DB Connect access. However, it should be possible to find an adequate, customer-specific solution for most of these scenarios.
    In such situations, the resulting work falls into the area of Consulting and cannot be handled via Support.
    Successful implementation of a connection requires corresponding expertise and experience in the use of the source database in the areas:
                    - Tools
                    - SQL syntax
                    - DB-specific functions
    Corresponding knowledge of the source application is also required to ensure that semantically relevant data arrives in the BW system.
    Procedure
    You should execute the following steps to connect the source system (Q) to the BW system (BW):
    Installing the client software on an BW application server
                         Of course, you only need to install the client software if you are using BW with a non-Oracle database.
                         Use the Oracle setup program on the database CD (runInstaller on Unix) to start the OracleInstaller. Follow the program instructions and the DB installation instructions to install the Oracle Client software on BW.
    Testing connection setup from BW to Q
                         After you install the client software on BW, try to set up a connection from BW to the server on Q. You may need to adjust the tnsnames.ora or sqlnet.ora files for this, to introduce the Oracle systems (to which contact should be made) to BW. You can test the connection by executing the command "tnsping QDB" on BW to check whether the client has established contact to the QDB database on the Q system.
    Creating a separate U user in Q
                         We recommend that you create a separate U user in Q for connection to BW. This means that authorization and administration questions can be solved centrally.
    Displaying data sources in Q for the U user
                         To provide U data for users other than U, you can create views on other user tables as user U:
                         CREATE OR REPLACE VIEW viewname AS
                           SELECT * FROM QDB.tablename
                         You may have to grant SELECT privileges to user U in the QDB schema:
                            GRANT select ON QDB.tablename TO U
                         Of course, you can also restrict or reformat data in the view arrangement (for example, change from internal date format into the SAP date format). JOIN operations using several tables are also available.
                         !!! Synonyms do not yet work!!!
                         Synonyms that you can create as described below are another option for providing a complete table for the user U:
                           CREATE SYNONYM synoname FOR QDB.tablename
                         !!! Synonyms do not (yet) work!!!
                         After you have displayed the require data for user U, you can simply use
                           SELECT * FROM <view or table>
                         on the Q system to check which data is returned.
                         You can now open a link to Q as user U in the BW system with SQLPLUS and check, using the same SELECT, whether this data is also seen in the Oracle client. If this is not the case, there is probably a connection problem.
    Creating a connection from BW to Q in BW
    Including data sources of user U user in Q in BW.
    Solution
    Supported BW, Basis and BW 3.0B database versions, Basis 6.20 Support Package 2 (or higher)
          Oracle 8.1 (or higher, see below)
    Possible problems
    - Synonyms do not (yet) work!
    Up to now, only tables and views have been used as data sources for the DB Connect from the R3 Basis. As soon as synonyms are also used in the Basis, you will be able to convert created views (or even replicated tables) to synonyms as a workaround.
    With Basis 6.40 at the earliest, therefore as of BW 3.5, you will also be able to use synonyms. Until then, the following will help:
      CREATE VIEW <view_on_synonym> AS SELECT * FROM <synonym>
    - The source DB must have at least the release version of the BW DB.
    Oracle only ensures the support of client-server links if the version of the client is not higher than that of the server. So if BW has Oracle version 8.1 and, as in the case of Dbconnect, is run as a client against the server of the source database, the source database must have at least release Oracle 8.1 or higher.
    Of course, you have the option to install the Oracle client software of a lower version and then use this for the DB connect. This is also the procedure used to work with a DB connect on external databases of other vendors.
    Furthermore, the implementation of the DBconnect function in BW uses SAP Basis functions. Specifications of Oracle 8.1 database catalogs are used here. The source database must therefore have at least Version 8.1.
    - Oracle Client Software Version
    If you want to connect from an Oracle BW DB to an Oracle source DB, for the DB connect you naturally use the client software that you already installed on each application server.
    If you want to connect from a non-Oracle BW DB to an Oracle source DB, check item 3 of note 521230 to see which Oracle client software version is released with your BW R3 kernel and use this version.
    - Date and time fields in Oracle and their conversion into SAP-compatible column formats
    Example with a DATE field:
    Since a SAP table does not have a DATE field (date values are NUMC(8) and time specifications are NUMC(6)), we will use the Oracle DBA_TABLES system table as an example.
        SQL> desc dba_tables;
    The Oracle DBA_TABLES system table has a LAST_ANALYZED field. This is a DATE type field and is recognized as a date field of 7 characters by DBA_CONNECT. However, the import does not work because the DATE is a 7-byte conglomerate of "...century, year, month, date, hour, minute and second." (extract from the Oracle documentation).
    To make this DATE field legible for DB connect, you must use the TO_CHAR function in a VIEW. This should display the following examples:
    SQL> select LAST_ANALYZED from dba_tables
          where table_name like 'RS%' and rownum < 10 ;
    The formatting used here is the default used implicitly by SQLPLUS.
    SQL> select  to_char(LAST_ANALYZED,'YYYYMMDD') as dat from dba_tables where table_name like 'RS%' and rownum < 10 ;
    The result now has the SAP compatible format YYYYMMDD and should be loaded correctly by the DB connect as a date.
    SQL> select  to_char(LAST_ANALYZED,'HH24MISS') as tim from dba_tables where table_name like 'RS%' and rownum < 10 ;
    The result now has the SAP compatible format HHMMSS and should be loaded correctly by the DB connect as a time.
    You can use the following example for more detailed experiments:
    SQL> select  to_char(
           TO_DATE('03-FEB-2001 04:05:06','DD-MON-YYYY HH24:MI:SS'),
           'YY-MM-DD HH24-MI-SS') as datim from dual;
    with the result:
      DATIM
      01-02-03 04-05-06
    When you create a VIEW and use the TO_CHAR function (or other functions), you should easily be able to avoid problems with the interpretation of date/time specifications (and other reformatting).
    Details about the functions and the formats are contained in the Oracle documentation.
    - Special characters
    A words that contain special characters can only be imported correctly if the code pages in BW and in the source system are identical. If the code pages are not the same, DB Connect can be used if the characters to be imported appear under the first 127 characters of the character set.
    The use of multibyte code pages in the source system for saving data using character sets with more than 256 characters (Kanji, Katakana, Hiragana, Korean, Chinese, Tagalog, Khmer, Arabic, Cherokee, and so on) can cause the characters to become corrupt.
    For questions concerning the code pages, also refer to the FAQ note 606359 and question/answer 19 that appears there.

  • Error while retrieving data from PL/SQL Table using SELECT st. (Urgent!!!)

    Hi Friends,
    I am using Oracle 8.1.6 Server, & facing problems while retrieving data from a PL/SQL Table:
    CREATE or REPLACE PROCEDURE test_proc IS
    TYPE tP2 is TABLE of varchar2(10); --declared a collection
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST(dt2 as tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    While executing the above procedure, I encountered foll. error:
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [],
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [], [], [], [], []
    ORA-06553: PLS-801: internal error [0]
    Can anyone please help me, where the problem is??
    Is it Possible to retrieve data from PL/SQL TABLE using SELECT statement? & How ?
    Thanks in advance.
    Best Regards,
    Jay Raval.

    Thanks Roger for the Update.
    It means that have to first CREATE TYPE .. TABLE in database then only I can fire a Select statement on that TYPE.
    Actually I wanted to fire a Select statement on the TABLE TYPE, defined & declared in PLSQL stored procedure using DECLARE TYPE .. TABLE & not using CREATE TYPE .. TABLE.
    I was eager to know this, because my organization is reluctant in using CREATE TYPE .. TABLE defined in the database, so I was looking out for another alternative to access PL/SQL TABLE using Select statement without defining it database. It would have been good if I could access a PLSQL TABLE using Select statement Declared locally in the stored procedure.
    Can I summarize that to access a PL/SQL TABLE using SELECT statement, I have to first CREATE TYPE .. TABLE?
    If someone have any other idea on this, please do let me know.
    Thanks a lot for all help.
    Best Regards,
    Jay Raval.
    You have to define a database type...
    create type tP2 is table of varchar2(10)
    CREATE OR REPLACE PROCEDURE TEST_PROC
    IS
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST (dt2 AS tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    This will work.
    Roger

  • Load XML-data from large file into plain table

    We have to load data from an XML file to a relational table row by row.
    The structure of the data is very simple:
    <ROOT>
    <repReport>
    <KNZ>XY</KNZ>
    <LA>test123</LA>
    <Ident>AA20</Ident>
    </repReport>
    <repReport>
    </repReport>
    </ROOT>.
    The table econtains the fields KNZ, LA, Ident, ...
    If the file is small the following PL/SQL-code works fine:
    CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
    fil BFILE ;
    len INTEGER;
    insrow INTEGER;
    ctxHdl NUMBER;
    buffer_c CLOB ;
    amt NUMBER := dbms_lob.lobmaxsize;
    src_offset NUMBER := 1 ;
    dst_offset NUMBER := 1 ;
    lang_ctx NUMBER := dbms_lob.default_lang_ctx;
    warning NUMBER;
    errNo NUMBER;
    errMsg VARCHAR2(1999);
    BEGIN
    fil := BFILENAME('XML_DIR','200412MKBReport.xml');
    DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
    len := DBMS_LOB.GETLENGTH(fil);
    INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
    RETURNING init INTO buffer_c;
    dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
    ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
    dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
    dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
    dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
    dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
    dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
    dbms_xmlsave.SetBatchSize(ctxHdl , 1);
    insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
    DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLCODE);
    errMsg := SQLERRM;
    DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    END;
    But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
    Does anybody have an example how to load this data that is as simple as our problem?

    We have to load data from an XML file to a relational table row by row.
    The structure of the data is very simple:
    <ROOT>
    <repReport>
    <KNZ>XY</KNZ>
    <LA>test123</LA>
    <Ident>AA20</Ident>
    </repReport>
    <repReport>
    </repReport>
    </ROOT>.
    The table econtains the fields KNZ, LA, Ident, ...
    If the file is small the following PL/SQL-code works fine:
    CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
    fil BFILE ;
    len INTEGER;
    insrow INTEGER;
    ctxHdl NUMBER;
    buffer_c CLOB ;
    amt NUMBER := dbms_lob.lobmaxsize;
    src_offset NUMBER := 1 ;
    dst_offset NUMBER := 1 ;
    lang_ctx NUMBER := dbms_lob.default_lang_ctx;
    warning NUMBER;
    errNo NUMBER;
    errMsg VARCHAR2(1999);
    BEGIN
    fil := BFILENAME('XML_DIR','200412MKBReport.xml');
    DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
    len := DBMS_LOB.GETLENGTH(fil);
    INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
    RETURNING init INTO buffer_c;
    dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
    ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
    dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
    dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
    dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
    dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
    dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
    dbms_xmlsave.SetBatchSize(ctxHdl , 1);
    insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
    DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLCODE);
    errMsg := SQLERRM;
    DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
    IF DBMS_LOB.ISOPEN(fil) = 1 THEN
    DBMS_LOB.CLOSE(fil);
    END IF;
    END;
    But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
    Does anybody have an example how to load this data that is as simple as our problem?

  • Generate xml from non-relational table

    Hi
    I would like to create hierarchical xml from non-relational table as below, can anybody share some idea?
    I have tried the XMLAgg/XmlElement and could not get the desired result. Any help would be greately appreciated.
    create table testing
    ( super_cat varchar2(30)
    , normal_cat varchar2(30)
    , sub_cat varchar2(30)
    , detail varchar2(30));
    CREATE UNIQUE INDEX IDX_TESTING ON TESTING(SUPER_CAT,NORMAL_CAT,SUB_CAT);
    insert into testing values ('SUPER_A','NORMAL_A','SUB_A', 'DETAIL1');
    insert into testing values ('SUPER_A','NORMAL_A','SUB_B', 'DETAIL2');
    insert into testing values ('SUPER_A','NORMAL_B','SUB_A', 'DETAIL3');
    insert into testing values ('SUPER_A','NORMAL_B','SUB_B', 'DETAIL4');
    COMMIT;The result should be like :
    <Document>
    <SuperCategory>
    <SuperCategoryName>SUPER_A</SuperCategoryName>
    <NormalCategory>
    <NormalCategoryName>NORMAL_A</NormalCategoryName>
    <SubCategory>
    <SubCategoryName>SUB_A</SubCategoryName>
    <ResultDetail><Detail>DETAIL1</Detail></ResultDetail>
    </SubCategory>
    <SubCategory>
    <SubCategoryName>SUB_B</SubCategoryName>
    <ResultDetail><Detail>DETAIL2</Detail></ResultDetail>
    </SubCategory>
    </NormalCategory>
    <NormalCategory>
    <NormalCategoryName>NORMAL_B</NormalCategoryName>
    <SubCategory>
    <SubCategoryName>SUB_A</SubCategoryName>
    <ResultDetail><Detail>DETAIL3</Detail></ResultDetail>
    </SubCategory>
    <SubCategory>
    <SubCategoryName>SUB_B</SubCategoryName>
    <ResultDetail><Detail>DETAIL4</Detail></ResultDetail>
    </SubCategory>
    </NormalCategory>
    </SuperCategory>
    </Document>

    user563940 wrote:
    Hi
    I would like to create hierarchical xml from non-relational table as below, can anybody share some idea?
    I have tried the XMLAgg/XmlElement and could not get the desired result. Any help would be greately appreciated.I think you should be able to achieve this with the addition of XMLFOREST.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions244.htm#SQLRF06169

Maybe you are looking for

  • Adding a new column to af:query on af:table

    Hi, I have an ADF table added to a jspx page as below: <af:table value="#{bindings.RuleLibraryVO1.collectionModel}" var="row" rows="#{bindings.RuleLibraryVO1.rangeSize}" emptyText="#{bindings.RuleLibraryVO1.viewable ? coregccomplianceuiBundle.MSG_NO_

  • Video is randomly distorted (color inverted) in Premiere Pro CC 2014

    Below is a screen grab of what the distortion looks like. It happens regardless of CODEC, sequence setting or type of video file. It happens to MPG, MOV and AVI files equally. It even happens to still graphics. Here are the particulars for my compute

  • JSP is executed 2 times

    Hello to everybody. I have a problem using the OutputStream of the response object in a jsp. I use the page to show a pdf document that it's created from a method of a bean. The response.getOutputStream is a parameter of the method and it writes the

  • Unable to find an entry point named 'imaqCreat​eImage' in DLL ...

    Firstly some background: Using Microsoft's managed extensibility framework (MEF), I've created a "Test Tool" framework which accepts plugins. The plugins are generally HW drivers with UIs. I created a NI Vision plugin  which does camera discovery, ac

  • Finding proper help on Hierarchical Trees

    Have spent a couple of hours trying to navigate the sprawling website of oracle.com with the purpose finding and then downloading the appropriate help file. I downloaded Oracle9i Developer Suite Release 2 Documentation Library from http://www.oracle.