Create Big XML files ( extract ) from Relational Tables

Experts: I need to create a big XML extract more than 5Gb , from relations tables using SQLX. I read the excellent FAQ given by MDrake in the following thread.
https://forums.oracle.com/thread/418001
Question
1) Is it better to use XML schema, My XML output format is pretty much going to be static, so I can register an XML schema .
2) Does Registering the XMLschema help with better memory management. I recall I used to get out of memory exception when I generated xml documents on oracle 10g using DBMS_XMLGEN.
3) Can I generate this 5 Gb of XML file using oracle's default DOM parser?
Thanks
Kevin

Hi Kevin,
1) Is it better to use XML schema, My XML output format is pretty much going to be static, so I can register an XML schema .
2) Does Registering the XMLschema help with better memory management. I recall I used to get out of memory exception when I generated xml documents on oracle 10g using DBMS_XMLGEN.
No, an XML schema won't help for the generation.
It is useful though if you're looking for the opposite task, i.e. loading an XML file into database tables.
3) Can I generate this 5 Gb of XML file using oracle's default DOM parser?
What is the default DOM parser ? Do you mean DBMS_XMLDOM APIs?
Since you want to generate XML, there's not much to parse.
Generally, using SQL/XML functions is the way to go.
You may still hit some performance/memory issues while reaching such a size, especially with large XMLAgg aggregation context.
If you do, you may switch to chunk generation instead. I've got some pretty good result with this approach and the parallel query feature.

Similar Messages

  • Create a large XML extract from relational tables - 10g

    The Oracle 10g documentation recommends using the various SQL functions such as XMLAGG,XMLELEMENT or DBMS_XMLGEN under chapter "16 Generating XML Data from the Database" for generating a XML extract file. The DBMS_XMLDOM seems like a useful structured package to create a XML formatted extract. Any idea why Oracle does not recommend the use of XMLDOM API ? Are there performance issues or likely de-support ?
    Whats the best way to produce a large XML extract?
    Thanks.

    mdrake wrote:
    No reason not to use it. It just tends to require a lot more coding than the other methods. Underneath the covers they all map into the same code-line. In general, to generate a given XML document you wlll write far fewer lines of code using the SQL/XML operators. Less Code written = less code to maintan = faster time to market.Less code to parse...?

  • Error  while export data from a xml file to an relational table

    Hi,
    I am Creating an ODI Project: Developing an ODI XML to Database Transformation Using Interface with ODI Constraint following this link
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_xml-to-table/odi_project_xml-to-table.htm
    This project executed successfully with some warning.*Target Table is automatically created in database and also populated with data*.But when I right-click Target Datastore(in Mapping Tab of the Interface), and then select Data to View Data that needs to be inserted in the target table. I get some error like this:-
    Execution of Query Failed.
    Details:-
    See com.borland.dx.dataset.DataSetException error code: BASE+62
    com.borland.dx.dataset.DataSetException: Execution of query failed.
         at com.borland.dx.dataset.DataSetException.a(Unknown Source)
         at com.borland.dx.dataset.DataSetException.queryFailed(Unknown Source)
         at com.borland.dx.sql.dataset.QueryProvider.a(Unknown Source)
         at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown Source)
         at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
         at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)
         at com.sunopsis.graphical.frame.DwgDataFrame.initialize(DwgDataFrame.java:368)
         at com.sunopsis.graphical.frame.DwgDataFrame.<init>(DwgDataFrame.java:77)
         at oracle.odi.ui.etlmodeler.diag.inspector.pane.popup.DiagramActionDispayDataTarget.actionPerformed(DiagramActionDispayDataTarget.java:91)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
         at java.awt.Component.processMouseEvent(Component.java:6263)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6028)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4630)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4460)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4460)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Chained exception:
    java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:947)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1283)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1441)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3823)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1671)
         at com.borland.dx.sql.dataset.o.f(Unknown Source)
         at com.borland.dx.sql.dataset.QueryProvider.e(Unknown Source)
         at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown Source)
         at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
         at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)
         at com.sunopsis.graphical.frame.DwgDataFrame.initialize(DwgDataFrame.java:368)
         at com.sunopsis.graphical.frame.DwgDataFrame.<init>(DwgDataFrame.java:77)
         at oracle.odi.ui.etlmodeler.diag.inspector.pane.popup.DiagramActionDispayDataTarget.actionPerformed(DiagramActionDispayDataTarget.java:91)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
         at java.awt.Component.processMouseEvent(Component.java:6263)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6028)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4630)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4460)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4460)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Please Help

    Michael R wrote:
    The target table will be created when you execute the interface, if you set the option on the flow tab as instructed in step #6 of the "Setting up ODI Constraint on CLIENT Datastore" Section.
    Option     Value
    CREATE_TARG_TABLE      trueHi Michel,
    This was not my required answer.I am sorry that I was unable to clarify my question.Actually
    +This project executed successfully with some warning.Target Table is automatically created in database and also populated with data.But when I right-click Target Datastore(in >Mapping Tab of the Interface), and then select Data to View Data that needs to be inserted in the target table.I get some error like this:-...+This above line is the result of my project my problem is
    when I right-click Target Datastore(in Mapping Tab of the Interface), and then select Data to View Data that already inserted in the target table.Is not shown by the view data operation.
    I meant to say I am facing this error
    At the10(1010 written) step of
    Creating a New ODI Interface to Perform XML File to RDBMS Table Transformation
    wehre it says
    Open the Interface tab. Select Mapping tab, right-click Target Datastore - CLIENT, and then select Data. View Data inserted in the target table. Close Data Editor. Close the tabs...
    In my case when I use my sqldeveloper I can see data successfully inserted in my target table and also in error table (data that can't satisfy the constraint) .But I was unable to check this by following the above mentioned 10 th step and got this error.
    Thanks

  • Approach to parse large number of XML files into the relational table.

    We are exploring the option of XML DB for processing a large number of files coming same day.
    The objective is to parse the XML file and store in multiple relational tables. Once in relational table we do not care about the XML file.
    The file can not be stored on the file server and need to be stored in a table before parsing due to security issues. A third party system will send the file and will store it in the XML DB.
    File size can be between 1MB to 50MB and high performance is very much expected other wise the solution will be tossed.
    Although we do not have XSD, the XML file is well structured. We are on 11g Release 2.
    Based on the reading this is what my approach.
    1. CREATE TABLE XML_DATA
    (xml_col XMLTYPE)
    XMLTYPE xml_col STORE AS SECUREFILE BINARY XML;
    2. Third party will store the data in XML_DATA table.
    3. Create XMLINDEX on the unique XML element
    4. Create views on XMLTYPE
    CREATE OR REPLACE FORCE VIEW V_XML_DATA(
       Stype,
       Mtype,
       MNAME,
       OIDT
    AS
       SELECT x."Stype",
              x."Mtype",
              x."Mname",
              x."OIDT"
       FROM   data_table t,
              XMLTABLE (
                 '/SectionMain'
                 PASSING t.data
                 COLUMNS Stype VARCHAR2 (30) PATH 'Stype',
                         Mtype VARCHAR2 (3) PATH 'Mtype',
                         MNAME VARCHAR2 (30) PATH 'MNAME',
                         OIDT VARCHAR2 (30) PATH 'OID') x;
    5. Bulk load the parse data in the staging table based on the index column.
    Please comment on the above approach any suggestion that can improve the performance.
    Thanks
    AnuragT

    Thanks for your response. It givies more confidence.
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    Example XML
    <SectionMain>
    <SectionState>Closed</SectionState>
    <FunctionalState>CP FINISHED</FunctionalState>
    <CreatedTime>2012-08</CreatedTime>
    <Number>106</Number>
    <SectionType>Reel</SectionType>
    <MachineType>CP</MachineType>
    <MachineName>CP_225</MachineName>
    <OID>99dd48cf-fd1b-46cf-9983-0026c04963d2</OID>
    </SectionMain>
    <SectionEvent>
    <SectionOID>99dd48cf-2</SectionOID>
    <EventName>CP.CP_225.Shredder</EventName>
    <OID>b3dd48cf-532d-4126-92d2</OID>
    </SectionEvent>
    <SectionAddData>
    <SectionOID>99dd48cf2</SectionOID>
    <AttributeName>ReelVersion</AttributeName>
    <AttributeValue>4</AttributeValue>
    <OID>b3dd48cf</OID>
    </SectionAddData>
    - <SectionAddData>
    <SectionOID>99dd48cf-fd1b-46cf-9983</SectionOID>
    <AttributeName>ReelNr</AttributeName>
    <AttributeValue>38</AttributeValue>
    <OID>b3dd48cf</OID>
    <BNCounter>
    <SectionID>99dd48cf-fd1b-46cf-9983-0026c04963d2</SectionID>
    <Run>CPFirstRun</Run>
    <SortingClass>84</SortingClass>
    <OutputStacker>D2</OutputStacker>
    <BNCounter>54605</BNCounter>
    </BNCounter>
    I was not aware of Virtual column but looks like we can use it and avoid creating views by just inserting directly into
    the staging table using virtual column.
    Suppose OID id is the unique identifier of each XML FILE and I created virtual column
    CREATE TABLE po_Virtual OF XMLTYPE
    XMLTYPE STORE AS BINARY XML
    VIRTUAL COLUMNS
    (OID_1 AS (XMLCAST(XMLQUERY('/SectionMain/OID'
    PASSING OBJECT_VALUE RETURNING CONTENT)
    AS VARCHAR2(30))));
    1. My question is how then I will write this query by NOT USING COLMUN XML_COL
    SELECT x."SECTIONTYPE",
    x."MACHINETYPE",
    x."MACHINENAME",
    x."OIDT"
    FROM po_Virtual t,
    XMLTABLE (
    '/SectionMain'
    PASSING t.xml_col                          <--WHAT WILL PASSING HERE SINCE NO XML_COL
    COLUMNS SectionType VARCHAR2 (30) PATH 'SectionType',
    MachineType VARCHAR2 (3) PATH 'MachineType',
    MachineName VARCHAR2 (30) PATH 'MachineName',
    OIDT VARCHAR2 (30) PATH 'OID') x;
    2. Insetead of creating the view then Can I do
    insert into STAGING_table_yyy ( col1 ,col2,col3,col4,
    SELECT x."SECTIONTYPE",
    x."MACHINETYPE",
    x."MACHINENAME",
    x."OIDT"
    FROM xml_data t,
    XMLTABLE (
    '/SectionMain'
    PASSING t.xml_col                         <--WHAT WILL PASSING HERE SINCE NO XML_COL
    COLUMNS SectionType VARCHAR2 (30) PATH 'SectionType',
    MachineType VARCHAR2 (3) PATH 'MachineType',
    MachineName VARCHAR2 (30) PATH 'MachineName',
    OIDT VARCHAR2 (30) PATH 'OID') x
    where oid_1 = '99dd48cf-fd1b-46cf-9983';<--VIRTUAL COLUMN
    insert into STAGING_table_yyy ( col1 ,col2,col3
    SELECT x."SectionOID",
    x."EventName",
    x."OIDT"
    FROM xml_data t,
    XMLTABLE (
    '/SectionMain'
    PASSING t.xml_col                         <--WHAT WILL PASSING HERE SINCE NO XML_COL
    COLUMNS SectionOID PATH 'SectionOID',
    EventName VARCHAR2 (30) PATH 'EventName',
    OID VARCHAR2 (30) PATH 'OID',
    ) x
    where oid_1 = '99dd48cf-fd1b-46cf-9983';<--VIRTUAL COLUMN
    Same insert for other tables usind the OID_1 virtual coulmn
    3. Finaly Once done how can I delete the XML document from XML.
    If I am using virtual column then I beleive it will be easy
    DELETE table po_Virtual where oid_1 = '99dd48cf-fd1b-46cf-9983';
    But in case we can not use the Virtual column how we can delete the data
    Thanks in advance
    AnuragT

  • Creating XML from Relational Tables using java

    I would like to create an XML document by querying relational tables in java
    try {
            connection = getConnection();
            final String qryStr = "select XMLElement( foo, 'bar' ) from dual";
            final OracleXMLQuery qry = new OracleXMLQuery(connection, qryStr);
            final String xmlString = qry.getXMLString();
    I would expect this to give the following result that I get from running the statement in SQL Developer
    select XMLElement( foo, 'bar' ) from dual
    <FOO>bar</FOO>
    Instead I get
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an XML tag name.</ERROR>
    Is this the correct way to go about this?

    Is this the correct way to go about this?
    Not really.
    OracleXMLQuery class is the Java-side implementation of DBMS_XMLQUERY APIs.
    It's mostly designed to generate a canonical XML document out of a SQL query.
    Assuming a query like "SELECT col1, col2 FROM my_table", the resulting XML should appear like this :
    <ROWSET>
      <ROW>
        <COL1>123</COL1>
        <COL2>ABC</COL2>
      </ROW>
      <ROW>
        <COL1>456</COL1>
        <COL2>XYZ</COL2>
      </ROW>
    </ROWSET>
    So in your test, since the resulting column is not aliased (XMLElement), you're actually trying to generate something like this :
    <ROWSET>
      <ROW>
        <XMLELEMENT(FOO,'BAR')>
          <FOO>bar</FOO>
        </XMLELEMENT(FOO,'BAR')>
      </ROW>
    <ROWSET>
    which of course is invalid, hence the error message.
    If you want to generate only <FOO>bar</FOO> as output, just use a regular PreparedStatement with your query and access the document in the ResultSet with the proper getter.

  • URGENT --  Perofrmance issue while creating Huge XML file

    All XML Experts Please Help....Thanks a lot in Advance
    We are trying to create a XML file for a huge table.. 5 million rows and the performance is ver very bad.. Can some body help by giving me an idea what what my best approch could be... or what am I doing wrong in in the code below
    CREATE OR REPLACE PROCEDURE Sales_1_Generate_Xml IS
    temp_clob CLOB;
    temp_buffer VARCHAR2(1);
    amount BINARY_INTEGER := 1;
    position INTEGER := 1;
    filehandle utl_file.file_type;
    error_number NUMBER;
    error_message VARCHAR2(100);
    length_count INTEGER;
    qryctx dbms_xmlgen.ctxhandle;
    BEGIN
    qryctx := dbms_xmlgen.newcontext('select /* INDEX UF_SALES(UF_SALES_IX16) */
    TRANSACTION_NUMBER     "Transaction_Number",
    TRANSACTION_TYPE_ID     "Transaction_Type_ID",
    PROCESS_FISCAL_DATE_ID     "Process_Fiscal_Date_ID",
    INVOICE_FISCAL_DATE_ID     "Invoice_Fiscal_Date_ID",
    ORDER_FISCAL_DATE_ID     "Order_Fiscal_Date_ID",
    PROCESS_CALENDAR_DATE_ID     "Process_Calendar_Date_ID",
    INVOICE_CALENDAR_DATE_ID     "Invoice_Calendar_Date_ID",
    ORDER_CALENDAR_DATE_ID     "Order_Calendar_Date_ID",
    CURRENT_TM_ID     "Current_TM_ID",
    CUSTOMER_ID     "Customer_ID",
    CUSTOMER_TYPE_ID     "Customer_Type_ID",
    CUSTOMER_LEVEL_ID     "Customer_Level_ID",
    ACCOUNT_TYPE_ID     "Account_Type_ID",
    TRADE_CLASS_ID     "Trade_Class_ID",
    DISTRIBUTOR_ID     "Distributor_ID",
    PRODUCT_ID     "Product_ID",
    ORDERED_PRODUCT_ID     "Ordered_Product_ID",
    BRAND_TYPE_ID     "Brand_Type_ID",
    LABEL_TYPE_ID     "Label_Type_ID",
    BRAND_LABEL_ID     "Brand_Label_ID",
    PRICED_BY_ID     "Priced_By_ID",
    SALES_UOM_ID     "Sales_UOM_ID",
    PURCHASING_UOM_ID     "Purchasing_UOM_ID",
    PRICING_UOM_ID     "Pricing_UOM_ID",
    NET_COST     "Net_Cost",
    NPA_S     "NPA_S",
    CMA_S     "CMA_S",
    NOT_S     "NOT_S",
    TOTAL_NATIONAL_ALLOWANCE_S     "Total_National_Allowance_S",
    LPA_S     "LPA_S",
    LMA_S     "LMA_S",
    LOT_S     "LOT_S",
    TOTAL_LOCAL_ALLOWANCE_S     "Total_Local_Allowance_S",
    TOTAL_ALLOWANCES_S     "Total_Allowances_S",
    LPC     "LPC",
    LPC_EXTENDED     "LPC_Extended",
    LPF     "LPF",
    LPF_EXTENDED     "LPF_Extended",
    TRUE_COST     "True_Cost",
    CDE     "CDE",
    LPP     "LPP",
    SURCHARGE     "Surcharge",
    COMBINED_SURCHARGE     "Combined_Surcharge",
    TOTAL_SURCHARGES     "Total_Surcharges",
    MARKET_COST     "Market_Cost",
    INSIDE_PAD     "Inside_Pad",
    SALES_REP_COST     "Sales_Rep_Cost",
    SALES_REP_MARGIN     "Sales_Rep_Margin",
    SALES_PRICE     "Sales_Price",
    SALES_TRUE_MARGIN     "Sales_True_Margin",
    NVD     "NVD",
    LVD     "LVD",
    NID     "NID",
    LID     "LID",
    TOTAL_VD     "Total_VD",
    TOTAL_ID     "Total_ID",
    TOTAL_DEVIATIONS     "Total_Deviations",
    GP1     "GP1",
    GP2     "GP2",
    DEVIATED_COST     "Deviated_Cost",
    ACTUAL_COST     "Actual_Cost",
    SALES_TAX     "Sales_Tax",
    QUANTITY_ORDERED     "Quantity_Ordered",
    QUANTITY_SHIPPED     "Quantity_Shipped",
    QUANTITY_DEVIATED     "Quantity_Deviated",
    QUANTITY_SUBBED     "Quantity_Subbed",
    UNITS_ORDERED     "Units_Ordered",
    EACHES_ORDERED     "Eaches_Ordered",
    EACH_CONVERSION_FACTOR     "Each_Conversion_Factor",
    UNITS_SHIPPED     "Units_Shipped",
    EACHES_SHIPPED     "Eaches_Shipped",
    SHIP_WEIGHT     "Ship_Weight",
    ACTUAL_GP_DLR     "Actual_GP_Dlr",
    TRUE_GP_DLR     "True_GP_Dlr",
    LANDED_GP_DLR     "Landed_GP_Dlr",
    LANDED_ACTUAL_GP_DLR     "Landed_Actual_GP_Dlr",
    INVOICE_GP_DLR     "Invoice_GP_Dlr",
    INVOICE_ACTUAL_GP_DLR     "Invoice_Actual_GP_Dlr",
    ADJUSTED_ACTUAL_GP_DLR     "Adjusted_Actual_GP_Dlr",
    EB_S     "EB_S",
    MB_S     "MB_S",
    ACTUAL_TM_ID     "Actual_TM_ID",
    ACTUAL_TM_NAME     "Actual_TM_Name",
    ACTUAL_DSM_ID     "Actual_DSM_ID",
    ACTUAL_DSM_NAME     "Actual_DSM_Name",
    INVOICE_NUMBER      "Invoice_Number ",
    CONTRACT_NUMBER     "Contract_Number",
    CUSTOMER_NUMBER     "Customer_Number",
    CUSTOMER     "Customer",
    PRODUCT_NUMBER     "Product_Number",
    MASTER_DISTRIBUTOR_ID     "Master_Distributor_ID",
    ORDERED_PRODUCT_NUMBER     "Ordered_Product_Number",
    NATIVE_PRODUCT_STATUS     "Native_Product_Status",
    NATIVE_PRICED_BY_INDICATOR     "Native_Priced_By_Indicator",
    EXTRACTION_TIME     "Extraction_Time"
    from uf_sales where distributor_id in (''5139'',
    ''5140'',
    ''5145'',
    ''5150'',
    ''5160'',
    ''5175'',
    ''5180'',
    ''5210'',
    ''5220'',
    ''5230'')
    DBMS_XMLGen.setRowTag(qryctx,'Sales_Record');
    DBMS_XMLGen.setRowSetTag(qryctx,'Sales_Set');
    temp_clob:=dbms_xmlgen.getxml(qryctx);
    length_count := dbms_lob.getlength(temp_clob);
    dbms_output.put_line('Internal LOB size is: ' || length_count);
    filehandle := utl_file.fopen('DATA_EXTRACT','Sales_1.xml','Wb',32767);
    WHILE length_count <> 0 LOOP
    dbms_lob.read (temp_clob, amount, position, temp_buffer);
    --utl_file.put (filehandle, temp_buffer);
    utl_file.put_raw(filehandle, utl_raw.cast_to_raw(temp_buffer));
    position := position + 1;
    length_count := length_count - 1;
    temp_buffer := null;
    END LOOP;
    dbms_output.put_line('Exit the loop');
    utl_file.fclose(filehandle);
    DBMS_XMLGen.closeContext(qryctx);
    dbms_output.put_line('Close the file');
    EXCEPTION
    WHEN OTHERS THEN
    BEGIN
    error_number := sqlcode;
    error_message := substr(sqlerrm ,1 ,100);
    dbms_output.put_line('Error #: ' || error_number);
    dbms_output.put_line('Error Message: ' || error_message);
    utl_file.fclose_all;
    END;
    END;
    /

    OK, so you are writing the file with UTL_FILE. How long is the whole process taking. Have you timed the time taken to generate the temp_clob with the result Vs the time to write the output to a file.

  • How to create xml file from relational tables in 10gR2

    Hi,
    I am very new to XML and was wondering how to create an XML file from querying relational tables. Some child tables may contain multiple rows that need to be returned in certain instances. Other queries will just be single or multiple rows from one or more tables. I would like to use the latest feathers in 10gR2. Thanks for any help you can provide.
    Thanks,
    Lee

    Here is the first row of data created from our person table - it used the column names as the tag names:
    <?xml version="1.0"?>
    <ROWSET>
         <ROW>
              <MP_ID_SEQ>289</MP_ID_SEQ>
              <MP_NAME>LOBERG,JUDITH LEE</MP_NAME>
              <MP_SEX>F</MP_SEX>
              <MP_RACE>I</MP_RACE>
              <MP_DOB>19500709</MP_DOB>
              <MP_HT>504</MP_HT>
              <MP_WT>170</MP_WT>
              <MP_EYE_CLR>BLU</MP_EYE_CLR>
              <MP_HAIR_CLR>BRO</MP_HAIR_CLR>
              <MP_SKN>RUD</MP_SKN>
              <MP_SMT>POCKMARKS</MP_SMT>
              <MP_SOC>517607968</MP_SOC>
              <MP_OLN>517607968</MP_OLN>
              <MP_OLS>MT</MP_OLS>
              <MP_OLY>2007</MP_OLY>
              <MP_CAUT_MED>70</MP_CAUT_MED>
              <MP_VISION_SCRIPT>C0RRECTIVE LENSES</MP_VISION_SCRIPT>
              <MP_DNA_AVAIL>N</MP_DNA_AVAIL>
              <CREATED_BY>MMPS</CREATED_BY>
              <DTM_CREATED>31-AUG-06</DTM_CREATED>
              <MI_INC_ID_SEQ>288</MI_INC_ID_SEQ>
              <MP_ALERT>N</MP_ALERT>
         </ROW>

  • Create a xml file from an internal table: CALL TRANSFORMATION

    Hello gurus,
    I want to create a xml file using data from scustom table. I will create an internal table and will select some records to it.
    I searched the forum and i discovered the call transformation, but when i execute the example program at the CALL TRANSFORMATION shows a dump screen.
    How we create a xml file from internal table??
    Please help me. I will mark the useful answers.

    I'm using if_ixml class to create xml documents
    TYPES: BEGIN OF xml_line,
             data(256) TYPE x,
           END OF xml_line.
    DATA: o_ixml          TYPE REF TO if_ixml,
          o_document      TYPE REF TO if_ixml_document,
          o_element       TYPE REF TO if_ixml_element,
          o_streamfactory TYPE REF TO if_ixml_stream_factory,
          o_ostream       TYPE REF TO if_ixml_ostream,
          o_renderer      TYPE REF TO if_ixml_renderer.
    DATA: t_xml_table     TYPE TABLE OF xml_line,
          v_xml_size      TYPE i.
    o_ixml = cl_ixml=>create( ).
    o_document = o_ixml->create_document( ).
    * The o_document have a set of methods to add elements, attributes, etc.
    o_element  = o_document->create_simple_element(
                      name = 'RootNode'
                      value = 'some text'
                      parent = o_document ).
    o_streamfactory = o_ixml->create_stream_factory( ).
    o_ostream = o_streamfactory->create_ostream_itable( table = t_xml_table ).
    o_renderer = o_ixml->create_renderer( ostream  = o_ostream document = o_document ).
    o_renderer->render( ).
    v_xml_size = o_ostream->get_num_written_raw( ).
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        bin_filesize = v_xml_size
        filename     = 'C:a.xml'
        filetype     = 'BIN'
      CHANGING
        data_tab     = t_xml_table.

  • Slow extraction in big XML-Files with PL/SQL

    Hello,
    i have a performance problem with the extraction from attributes in big XML Files. I tested with a size of ~ 30 mb.
    The XML file is a response of a webservice. This response include some metadata of a document and the document itself. The document is inline embedded with a Base64 conversion.  Here is an example of a XML File i want to analyse:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <ns2:GetDocumentByIDResponse xmlns:ns2="***">
             <ArchivedDocument>
                <ArchivedDocumentDescription version="1" currentVersion="true" documentClassName="Allgemeines Dokument" csbDocumentID="***">
                   <Metadata archiveDate="2013-08-01+02:00" documentID="123">
                      <Descriptor type="Integer" name="fachlicheId">
                         <Value>123<Value>
                      </Descriptor>
                      <Descriptor type="String" name="user">
                         <Value>***</Value>
                      </Descriptor>
                      <InternalDescriptor type="Date" ID="DocumentDate">
                         <Value>2013-08-01+02:00</Value>
                      </InternalDescriptor>
                      <!-- Here some more InternalDescriptor Nodes -->
                   </Metadata>
                   <RepresentationDescription default="true" description="Description" documentPartCount="1" mimeType="application/octet-stream">
                      <DocumentPartDescription fileName="20mb.test" mimeType="application/octet-stream" length="20971520 " documentPartNumber="0" hashValue=""/>
                   </RepresentationDescription>
                </ArchivedDocumentDescription>
                <DocumentPart mimeType="application/octet-stream" length="20971520 " documentPartNumber="0" representationNumber="0">
                   <Data fileName="20mb.test">
                      <BinaryData>
                        <!-- Here is the BASE64 converted document -->
                      </BinaryData>
                   </Data>
                </DocumentPart>
             </ArchivedDocument>
          </ns2:GetDocumentByIDResponse>
       </soap:Body>
    </soap:Envelope>
    Now i want to extract the filename and the Base64 converted document from this XML response.
    For the extraction of the filename i use the following command:
    v_filename := apex_web_service.parse_xml(v_xml, '//ArchivedDocument/ArchivedDocumentDescription/RepresentationDescription/DocumentPartDescription/@fileName');
    For the extraction of the binary data i use the following command:
    v_clob := apex_web_service.parse_xml_clob(v_xml, '//ArchivedDocument/DocumentPart/Data/BinaryData/text()');
    My problem is the performance of this extraction. Here i created some summary of the start and end time for the commands:
    Start Time
    End Time
    Difference
    Command
    10.09.13 - 15:46:11,402668000
    10.09.13 - 15:47:21,407895000
    00:01:10,005227
    v_filename_bcm := apex_web_service.parse_xml(v_xml, '//ArchivedDocument/ArchivedDocumentDescription/RepresentationDescription/DocumentPartDescription/@fileName');
    10.09.13 - 15:47:21,407895000
    10.09.13 - 15:47:22,336786000
    00:00:00,928891
    v_clob := apex_web_service.parse_xml_clob(v_xml, '//ArchivedDocument/DocumentPart/Data/BinaryData/text()');
    As you can see the extraction of the filename is slower then the document extraction. For the Extraction of the filename i need ~01
    I wonder about it and started some tests.
    I tried to use an exact - non dynamic - filename. So i have this commands:
    v_filename := '20mb_1.test';
    v_clob := apex_web_service.parse_xml_clob(v_xml, '//ArchivedDocument/DocumentPart/Data/BinaryData/text()');
    Under this Conditions the time for the document extraction soar. You can see this in the following table:
    Start Time
    End Time
    Difference
    Command
    10.09.13 - 16:02:33,212035000
    10.09.13 - 16:02:33,212542000
    00:00:00,000507
    v_filename_bcm := '20mb_1.test';
    10.09.13 - 16:02:33,212542000
    10.09.13 - 16:03:40,342396000
    00:01:07,129854
    v_clob := apex_web_service.parse_xml_clob(v_xml, '//ArchivedDocument/DocumentPart/Data/BinaryData/text()');
    So i'm looking for a faster extraction out of the xml file. Do you have any ideas? If you need more informations, please ask me.
    Thank you,
    Matthias
    PS: I use the Oracle 11.2.0.2.0

    Although using an XML schema is a good advice for an XML-centric application, I think it's a little overkill in this situation.
    Here are two approaches you can test :
    Using the DOM interface over your XMLType variable, for example :
    DECLARE
      v_xml    xmltype := xmltype('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
           <soap:Body> 
              <ns2:GetDocumentByIDResponse xmlns:ns2="***"> 
                 <ArchivedDocument> 
                    <ArchivedDocumentDescription version="1" currentVersion="true" documentClassName="Allgemeines Dokument" csbDocumentID="***"> 
                       <Metadata archiveDate="2013-08-01+02:00" documentID="123"> 
                          <Descriptor type="Integer" name="fachlicheId"> 
                             <Value>123</Value> 
                          </Descriptor> 
                          <Descriptor type="String" name="user"> 
                             <Value>***</Value> 
                          </Descriptor> 
                          <InternalDescriptor type="Date" ID="DocumentDate"> 
                             <Value>2013-08-01+02:00</Value> 
                          </InternalDescriptor> 
                          <!-- Here some more InternalDescriptor Nodes --> 
                       </Metadata> 
                       <RepresentationDescription default="true" description="Description" documentPartCount="1" mimeType="application/octet-stream"> 
                          <DocumentPartDescription fileName="20mb.test" mimeType="application/octet-stream" length="20971520 " documentPartNumber="0" hashValue=""/> 
                       </RepresentationDescription> 
                    </ArchivedDocumentDescription> 
                    <DocumentPart mimeType="application/octet-stream" length="20971520 " documentPartNumber="0" representationNumber="0"> 
                       <Data fileName="20mb.test"> 
                          <BinaryData> 
                            ABC123 
                          </BinaryData> 
                       </Data> 
                    </DocumentPart> 
                 </ArchivedDocument> 
              </ns2:GetDocumentByIDResponse> 
           </soap:Body> 
        </soap:Envelope>');
      domDoc    dbms_xmldom.DOMDocument;
      docNode   dbms_xmldom.DOMNode;
      node      dbms_xmldom.DOMNode;
      nsmap     varchar2(2000) := 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="***"';
      xpath_pfx varchar2(2000) := '/soap:Envelope/soap:Body/ns2:GetDocumentByIDResponse/';
      istream   sys.utl_characterinputstream;
      buf       varchar2(32767);
      numRead   pls_integer := 1;
      filename       varchar2(30);
      base64clob     clob;
    BEGIN
      domDoc := dbms_xmldom.newDOMDocument(v_xml);
      docNode := dbms_xmldom.makeNode(domdoc);
      filename := dbms_xslprocessor.valueOf(
                    docNode
                  , xpath_pfx || 'ArchivedDocument/ArchivedDocumentDescription/RepresentationDescription/DocumentPartDescription/@fileName'
                  , nsmap
      node := dbms_xslprocessor.selectSingleNode(
                docNode
              , xpath_pfx || 'ArchivedDocument/DocumentPart/Data/BinaryData/text()'
              , nsmap
      --create an input stream to read the node content :
      istream := dbms_xmldom.getNodeValueAsCharacterStream(node);
      dbms_lob.createtemporary(base64clob, false);
      -- read the content in 32k chunk and append data to the CLOB :
      loop
        istream.read(buf, numRead);
        exit when numRead = 0;
        dbms_lob.writeappend(base64clob, numRead, buf);
      end loop;
      -- free resources :
      istream.close();
      dbms_xmldom.freeDocument(domDoc);
    END;
    Using a temporary XMLType storage (binary XML) :
    create table tmp_xml of xmltype
    xmltype store as securefile binary xml;
    insert into tmp_xml values( v_xml );
    select x.*
    from tmp_xml t
       , xmltable(
           xmlnamespaces(
             'http://schemas.xmlsoap.org/soap/envelope/' as "soap"
           , '***' as "ns2"
         , '/soap:Envelope/soap:Body/ns2:GetDocumentByIDResponse/ArchivedDocument/DocumentPart/Data'
           passing t.object_value
           columns filename    varchar2(30) path '@fileName'
                 , base64clob  clob         path 'BinaryData'
         ) x

  • Building big XML file from scratch - Urgent

    Oracle 8.1.7.3 on windows NT platform
    What is the best way to generate a quiet big XML file from multiple tables ?
    I have information stored in many relational tables from which I need to generate a XML flat file either stored in a CLOB field or in a text file in a system directory. This XML file will be then used
    as an input to generate a report either in HTML using XSLT, or in a PDF file using apache-fop or in a MS Excel file using SoftArtisan ExcelWriter.
    My XML file has many levels in it structure, I mean that it is composed of one root element with 2 children, each children has a 3 children. One on these 3 children has 2 children and so on. Actually there are more or less 10 nested levels.
    To generate this XML file, I tried to use XSU for PL/SQL with the nested cursor() feature plus XSLT to transform the raw XML file to my requirements.
    But obviously there are some limitations using this method. Particularly, if the inner cursor returns an empty set I get exhausted resultset java error... A TAR confirmed that limitation.
    So I had to give up this method to use basic nested PL/SQL cursors. Each fetched row is then inserted into a table (varchar2) with a sequence number so that with a cursor like select xml_chunk from my_table order by sequence, I get the whole XML file that I save either in a flat file or in a CLOB (using append method).
    This method works fine, but it takes time and it's not flexible at all as I have to construct each XML tag. I guest this way of proceeding is not the more efficient...
    Using DOM method won't be better as I still need PL/SQL cursor to select each level of my XML structure and in addition I might for sure encounter a problem of memory.
    So what solutions would you suggest to generate this XML file. It must be quiet fast. The XML file can be up to 2Mo big. My system is actually a kind of on-the-fly reports generation. I mean that the XML file needs to be created with up-to-date data many times during the working hours !
    Quick answers or suggestions would be greatly appreciated. It's very urgent !!
    Thanks

    I looks like the best way is to using the SAX processing for your application? Do you know the DTD or XML schema of your output XML document?
    Would you send me the sample code for the method "to use XSU for PL/SQL with the nested cursor() feature plus XSLT to transform the raw XML file" to reproduce the problem?

  • Collect data from a dynamic XML file into multiple internal tables

    I need to convert the XML file into multiple internal tables. I tried many links and posts in SDN but still was facing difficulty in achieving this. Can some one tell me where I am going wrong.
    My XML file is of the following type.It is very complex and the dynamice.
    The following tags occur more than once in the XML file. The "I" and "L" tags and its child tags can occur ones or more than once for each XML file and it is not constant. i.e in one file they can occur 1 time and in another they can occur 100 times.
    "I" and "L" are child tags of <C>
    <I>
           <J>10</J>
             <K>EN</K>
      </I>
    <L>
             <J>20</J>
              <N>BB</N>
      </L>
    Tags <C> and <F> occur only ones for each XML file. <C> is the child tag of "A" and "F" is the child tag of <C>.
    I need to collect <D>, <E> in one internal table ITAB.
    I need to collect <G>, <H> in one internal table JTAB.
    I need to collect <J>, <K> in one internal table KTAB.
    I need to collect <J>, <N> in one internal table PTAB.
    Below is the complete XML file.
    ?xml version="1.0" encoding="iso-8859-1" ?>
    <A>
        <B/>
        <C>
           <D>RED</D>
           <E>999</E>
        <F>
           <G>TRACK</G>
           <H>PACK</H>
        </F>
        <I>
           <J>10</J>
           <K>EN</K>
        </I>
        <I>
           <J>20</J>
           <K>TN</K>
        </I>
        <I>
           <J>30</J>
           <K>KN</K>
        </I>
        <L>
           <J>10</J>
           <N>AA</N>
        </L>
        <L>
           <J>20</J>
           <N>BB</N>
        </L>
        <L>
           <J>30</J>
           <N>CC</N>
        </L>
        </C>
      </A>
    With the help of SDN I am able to gather the values of <D> <E> in one internal table.
    Now if I need to gather
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    I am unable to do. I am following  XSLT transformation method. If some one has some suggestions. Please help.
    Here is my ABAP program
    TYPE-POOLS abap.
    CONSTANTS gs_file TYPE string VALUE 'C:\TEMP\ABCD.xml'.
    * This is the structure for the data from the XML file
    TYPES: BEGIN OF ITAB,
             D(10) TYPE C,
             E(10) TYPE C,
           END OF ITAB.
    * Table for the XML content
    DATA: gt_itab       TYPE STANDARD TABLE OF char2048.
    * Table and work ares for the data from the XML file
    DATA: gt_ITAB     TYPE STANDARD TABLE OF ts_ITAB,
          gs_ITAB     TYPE ts_ITAB.
    * Result table that contains references
    * of the internal tables to be filled
    DATA: gt_result_xml TYPE abap_trans_resbind_tab,
          gs_result_xml TYPE abap_trans_resbind.
    * For error handling
    DATA: gs_rif_ex     TYPE REF TO cx_root,
          gs_var_text   TYPE string.
    * Get the XML file from your client
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = gs_file
      CHANGING
        data_tab                = gt_itab1
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        not_supported_by_gui    = 17
        error_no_gui            = 18
        OTHERS                  = 19.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Fill the result table with a reference to the data table.
    * Within the XSLT stylesheet, the data table can be accessed with
    * "IITAB".
    GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
    gs_result_xml-name = 'IITAB'.
    APPEND gs_result_xml TO gt_result_xml.
    * Perform the XSLT stylesheet
    TRY.
        CALL TRANSFORMATION zxslt
        SOURCE XML gt_itab1
        RESULT (gt_result_xml).
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    * Now let's see what we got from the file
    LOOP AT gt_ITAB INTO gs_ITAB.
      WRITE: / 'D:', gs_ITAB-D.
      WRITE: / 'E :', gs_ITAB-E.
    ENDLOOP.
    Transformation
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <IITAB>
              <xsl:apply-templates select="//C"/>
            </IITAB>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <item>
          <D>
            <xsl:value-of select="D"/>
          </D>
          <E>
            <xsl:value-of select="E"/>
          </E>
        </item>
      </xsl:template>
    </xsl:transform>
    Now the above pgm and transformation work well and I am able to extract data into the ITAB. Now what changes should I make in transformation and in pgm to collect
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    Please help..i am really tring hard to figure this out. I am found lot of threads addressing this issue but not my problem.
    Kindly help.
    Regards,
    VS

    Hi Rammohan,
    Thanks for the effort!
    But I don't need to use GUI upload because my functionality does not require to fetch data from presentation server.
    Moreover, the split command advised by you contains separate fields...f1, f2, f3... and I cannot use it because I have 164 fields.  I will have to split into 164 fields and assign the values back to 164 fields in the work area/header line.
    Moreover I have about 10 such work areas.  so the effort would be ten times the above effort! I want to avoid this! Please help!
    I would be very grateful if you could provide an alternative solution.
    Thanks once again,
    Best Regards,
    Vinod.V

  • Extracting data from Relational tables in 11.1.2.1

    I want to extract the following data sets from relational tables
    1. Attribute and its associated base member
    2. Smartlist value of an account
    Does any one have a code to extract this kind of data? Even pointing to the correct table names will be helpful.
    Thanks

    The table layouts can be found in the [documentation for EPMA|http://www.oracle.com/technetwork/middleware/bi-foundation/epm-data-models-11121-354684.zip] . If this doesn't work, there are other options to export hierarchies to text files. You can use life cycle management or the [EPMA File Generator|http://docs.oracle.com/cd/E17236_01/epm.1112/epma_file_gen_user/launch.html].
    Kyle Goodfriend
    http://www.in2hyperion.com
    Please make sure you assign your post as answered when an appropriate answer is provided (or helpful when applicable) so others benefit.

  • XML Data from Relational Tables

    Hi,
    My requirement is to pull data from relational tables into xml format and port it to the user (either as a file or allow the user to access it directly from their browser). What is the best way to accomplish this. Your suggestions are appreciated.
    thanks.

    Marco,
    Thanks for your reply, did try that , but I want the users to query this view also. Due to the nature of the xml structure I am getting the correct results. May be my xpath query is not right? My xml is as below:
    <node1 attribute-node1 = "somevalue1">
    <cnode1 attribute-cnode1 = "somevalue2">
    <cnode2 attribute-cnode2 = "somevalue3">
    <cnode3>somevalue4</cnode3>
    <cnode4>somevalue5</cnode4>
    </cnode2>
    <cnode2 attribute-cnode2 = "somevlaue6">
    <cnode3>somevalue6</cnode3>
    <cnode4>somevalue7</cnode4>
    </cnode2>
    </cnode1>
    </node1>
    and my requirement is like : the user wants to see only cnode2 with attribute value "somevalue3" (along with the rest of the xml) ie
    <node1 attribute-node1 = "somevalue1">
    <cnode1 attribute-cnode1 = "somevalue2">
    <cnode2 attribute-cnode2 = "somevalue3">
    <cnode3>somevalue4</cnode3>
    <cnode4>somevalue5</cnode4>
    </cnode2>
    </cnode1>
    </node1>
    Need the correct xpath query for this.
    Thanks

  • How to load the .xml file list from 'C:\Drag_list\Modif into xmltype table?

    Hi all experts,
    I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    is there anyone know why
    SQL> create or replace directory XMLDIR as '/xdb/faq/testdata'
    2 /
    SQL> set long 10000 pages 200 lines 150
    SQL> --
    SQL> select xmltype(bfilename('XMLDIR','2003.xml'),nls_charset_id('AL32UTF8'))
    2 from dual
    worked. but
    SQL> create or replace directory XMLDIR as 'C:\Drag_list\Modified';
    SQL> select xmltype(bfilename('XMLDIR','2011.xml'),nls_charset_id('AL32UTF8'))
    from dual
    did not work?
    IS there any way I can load the .xml file list from 'C:\Drag_list\Modified' into xmltype table?
    Thanks.
    Edited by: Cow on Apr 13, 2011 12:58 AM

    This is a question better suited for the sql and pl/sql support forum, since it is NOT an APEX based question..: PL/SQL
    Thank you,
    Tony Miller
    Webster, TX
    On the road of life...There are 'windshields', and there are 'bugs'
    (splat!)
    "Squeegees Wanted"
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Creating an xml file from abap code

    Hello All,
    Please let me know which FM do I need to execute in order to create an XML file from my ABAP code ?
    Thanks in advance,
    Paul.

    This has been discussed before
    XML files from ABAP programs

Maybe you are looking for