Interface to get inbond XML into tables

We have Oracle 7.3 and HP-UX. We have a requirement to get XML from client and get the data into our tables.
I think we need to install Oracle XDK and parse the XML and put it in Oracle using JDBC.
I need to know which version of XDK I should install in HP-UX/Oracle 7.3?
Can anyone provide a sample code to insert data from XML to tables?
We have a standard XML with data in tags. No attributes.

We have Oracle 7.3 and HP-UX. We have a requirement to get XML from client and get the data into our tables.
I think we need to install Oracle XDK and parse the XML and put it in Oracle using JDBC.
I need to know which version of XDK I should install in HP-UX/Oracle 7.3?
Can anyone provide a sample code to insert data from XML to tables?
We have a standard XML with data in tags. No attributes.

Similar Messages

  • Load nested XML into table

    Hello, could anyone help me on this? I have a XML file as below:
    <Feed>
    <svc>enr1</svc>
    <report_email>[email protected]</report_email>
    <requisition id="12">
    <email>[email protected]</email>
    <Name>Joseph</Name>
    <PRODUCT>
         <PROD_ID>532343234</PROD_ID>
         <NAME>KID'S WEAR </NAME>
         <DATE_ORDERED>09/04/2009</DATE_ORDERED>
    </PRODUCT>
    <PRODUCT>
         <PROD_ID>67045434</PROD_ID>
         <NAME>SHOES</NAME>
         <DATE_ORDERED>09/04/2009</DATE_ORDERED>
    </PRODUCT>
    </requisition>
    <requisition id="13">
    <email>[email protected]</email>
    <Name>Sarah</Name>
    <PRODUCT>
         <PROD_ID>11111111</PROD_ID>
         <NAME>LOST IN FOREST</NAME>
         <DATE_ORDERED>10/05/2008</DATE_ORDERED>
    </PRODUCT>
    <PRODUCT>
         <PROD_ID>222222222</PROD_ID>
         <NAME>TRY IT NOW</NAME>
         <DATE_ORDERED>09/04/2007</DATE_ORDERED>
    </PRODUCT>
    </requisition>
    </Feed>

    You could flatten the XML into table style output using XMLTABLE...
    WITH t as (select XMLTYPE('
    <RECSET>
      <REC>
        <COUNTRY>1</COUNTRY>
        <POINT>1800</POINT>
        <USER_INFO>
          <USER_ID>1</USER_ID>
          <TARGET>28</TARGET>
          <STATE>6</STATE>
          <TASK>12</TASK>
        </USER_INFO>
        <USER_INFO>
          <USER_ID>5</USER_ID>
          <TARGET>19</TARGET>
          <STATE>1</STATE>
          <TASK>90</TASK>
        </USER_INFO>
      </REC>
      <REC>
        <COUNTRY>2</COUNTRY>
        <POINT>2400</POINT>
        <USER_INFO>
          <USER_ID>3</USER_ID>
          <TARGET>14</TARGET>
          <STATE>7</STATE>
          <TASK>5</TASK>
        </USER_INFO>
      </REC>
    </RECSET>') as xml from dual)
    -- END OF TEST DATA
    select x.country, x.point, y.user_id, y.target, y.state, y.task
    from t
        ,XMLTABLE('/RECSET/REC'
                  PASSING t.xml
                  COLUMNS country NUMBER PATH '/REC/COUNTRY'
                         ,point   NUMBER PATH '/REC/POINT'
                         ,user_info XMLTYPE PATH '/REC/*'
                 ) x
        ,XMLTABLE('/USER_INFO'
                  PASSING x.user_info
                  COLUMNS user_id NUMBER PATH '/USER_INFO/USER_ID'
                         ,target  NUMBER PATH '/USER_INFO/TARGET'
                         ,state   NUMBER PATH '/USER_INFO/STATE'
                         ,task    NUMBER PATH '/USER_INFO/TASK'
                 ) y
       COUNTRY      POINT    USER_ID     TARGET      STATE       TASK
             1       1800          1         28          6         12
             1       1800          5         19          1         90
             2       2400          3         14          7          5Or you could shread the XML into Oracle nested tables...
    e.g.
    (Based on response from mdrake on this thread: Re: XML file processing into oracle
    Reading XML using a schema...
    declare
      SCHEMAURL VARCHAR2(256) := 'http://xmlns.example.org/xsd/testcase.xsd';
      XMLSCHEMA VARCHAR2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
         <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
            <xs:element name="cust_order" type="cust_orderType" xdb:defaultTable="CUST_ORDER_TBL"/>
            <xs:complexType name="groupType" xdb:maintainDOM="false">
                    <xs:sequence>
                            <xs:element name="item" type="itemType" maxOccurs="unbounded"/>
                    </xs:sequence>
                    <xs:attribute name="id" type="xs:byte" use="required"/>
            </xs:complexType>
            <xs:complexType name="itemType" xdb:maintainDOM="false">
                    <xs:simpleContent>
                            <xs:extension base="xs:string">
                                    <xs:attribute name="id" type="xs:short" use="required"/>
                                    <xs:attribute name="name" type="xs:string" use="required"/>
                            </xs:extension>
                    </xs:simpleContent>
            </xs:complexType>
            <xs:complexType name="cust_orderType" xdb:maintainDOM="false">
                    <xs:sequence>
                            <xs:element name="group" type="groupType" maxOccurs="unbounded"/>
                    </xs:sequence>
                    <xs:attribute name="cust_id" type="xs:short" use="required"/>
            </xs:complexType>
         </xs:schema>';
      INSTANCE  CLOB :=
    '<cust_order cust_id="12345">
      <group id="1">
        <item id="1" name="Standard Mouse">100</item>
        <item id="2" name="Keyboard">100</item>
        <item id="3" name="Memory Module 2Gb">200</item>
        <item id="4" name="Processor 3Ghz">25</item>
        <item id="5" name="Processor 2.4Ghz">75</item>
      </group>
      <group id="2">
        <item id="1" name="Graphics Tablet">15</item>
        <item id="2" name="Keyboard">15</item>
        <item id="3" name="Memory Module 4Gb">15</item>
        <item id="4" name="Processor Quad Core 2.8Ghz">15</item>
      </group>
      <group id="3">
        <item id="1" name="Optical Mouse">5</item>
        <item id="2" name="Ergo Keyboard">5</item>
        <item id="3" name="Memory Module 2Gb">10</item>
        <item id="4" name="Processor Dual Core 2.4Ghz">5</item>
        <item id="5" name="Dual Output Graphics Card">5</item>
        <item id="6" name="28inch LED Monitor">10</item>
        <item id="7" name="Webcam">5</item>
        <item id="8" name="A3 1200dpi Laser Printer">2</item>
      </group>
    </cust_order>';                
    begin
      dbms_xmlschema.registerSchema
         schemaurl       => SCHEMAURL
        ,schemadoc       => XMLSCHEMA
        ,local           => TRUE
        ,genTypes        => TRUE
        ,genBean         => FALSE
        ,genTables       => TRUE
        ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
      execute immediate 'insert into CUST_ORDER_TBL values (XMLTYPE(:INSTANCE))' using INSTANCE;
    end;
    desc CUST_ORDER_TBL
    SQL> desc CUST_ORDER_TBL
    Name                                                                                                                                    Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.org/xsd/testcase.xsd" Element "cust_order") STORAGE Object-relational TYPE "cust_orderType222_T"
    set autotrace on explain
    set pages 60 lines 164 heading on
    col cust_id format a8
    select extract(object_value,'/cust_order/@cust_id') as cust_id
          ,grp.id as group_id, itm.id as item_id, itm.inm as item_name, itm.qty as item_qty
    from   CUST_ORDER_TBL
          ,XMLTABLE('/cust_order/group'
                    passing object_value
                    columns id   number       path '@id'
                           ,item xmltype      path 'item'
                   ) grp
          ,XMLTABLE('/item'
                    passing grp.item
                    columns id   number       path '@id'
                           ,inm  varchar2(30) path '@name'
                           ,qty  number       path '.'
                   ) itm
    CUST_ID    GROUP_ID    ITEM_ID ITEM_NAME                        ITEM_QTY
    12345             1          1 Standard Mouse                        100
    12345             1          2 Keyboard                              100
    12345             1          3 Memory Module 2Gb                     200
    12345             1          4 Processor 3Ghz                         25
    12345             1          5 Processor 2.4Ghz                       75
    12345             2          1 Graphics Tablet                        15
    12345             2          2 Keyboard                               15
    12345             2          3 Memory Module 4Gb                      15
    12345             2          4 Processor Quad Core 2.8Ghz             15
    12345             3          1 Optical Mouse                           5
    12345             3          2 Ergo Keyboard                           5
    12345             3          3 Memory Module 2Gb                      10
    12345             3          4 Processor Dual Core 2.4Ghz              5
    12345             3          5 Dual Output Graphics Card               5
    12345             3          6 28inch LED Monitor                     10
    12345             3          7 Webcam                                  5
    12345             3          8 A3 1200dpi Laser Printer                2
    17 rows selected.Need at least 10.2.0.3 for performance i.e. to avoid COLLECTION ITERATOR PICKLER FETCH in execution plan...
    On 10.2.0.1:
    Execution Plan
    Plan hash value: 3741473841
    | Id  | Operation                          | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                   |                        | 24504 |    89M|   873   (1)| 00:00:11 |
    |   1 |  NESTED LOOPS                      |                        | 24504 |    89M|   873   (1)| 00:00:11 |
    |   2 |   NESTED LOOPS                     |                        |     3 | 11460 |   805   (1)| 00:00:10 |
    |   3 |    TABLE ACCESS FULL               | CUST_ORDER_TBL         |     1 |  3777 |     3   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN                | SYS_IOT_TOP_774117     |     3 |   129 |     1   (0)| 00:00:01 |
    |   5 |   COLLECTION ITERATOR PICKLER FETCH| XMLSEQUENCEFROMXMLTYPE |       |       |            |       |
    Predicate Information (identified by operation id):
       4 - access("NESTED_TABLE_ID"="CUST_ORDER_TBL"."SYS_NC0000900010$")
           filter("SYS_NC_TYPEID$" IS NOT NULL)
    Note
       - dynamic sampling used for this statementOn 10.2.0.3:
    Execution Plan
    Plan hash value: 1048233240
    | Id  | Operation               | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT        |                   |    17 |   132K|   839   (0)| 00:00:11 |
    |   1 |  NESTED LOOPS           |                   |    17 |   132K|   839   (0)| 00:00:11 |
    |   2 |   MERGE JOIN CARTESIAN  |                   |    17 |   131K|   805   (0)| 00:00:10 |
    |   3 |    TABLE ACCESS FULL    | CUST_ORDER_TBL    |     1 |  3781 |     3   (0)| 00:00:01 |
    |   4 |    BUFFER SORT          |                   |    17 | 70839 |   802   (0)| 00:00:10 |
    |*  5 |     INDEX FAST FULL SCAN| SYS_IOT_TOP_56154 |    17 | 70839 |   802   (0)| 00:00:10 |
    |*  6 |   INDEX UNIQUE SCAN     | SYS_IOT_TOP_56152 |     1 |    43 |     2   (0)| 00:00:01 |
    |*  7 |    INDEX RANGE SCAN     | SYS_C006701       |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       5 - filter("SYS_NC_TYPEID$" IS NOT NULL)
       6 - access("SYS_NTpzENS1H/RwSSC7TVzvlqmQ=="."NESTED_TABLE_ID"="SYS_NTnN5b8Q+8Txi9V
                  w5Ysl6x9w=="."SYS_NC0000600007$")
           filter("SYS_NC_TYPEID$" IS NOT NULL AND
                  "NESTED_TABLE_ID"="CUST_ORDER_TBL"."SYS_NC0000900010$")
       7 - access("SYS_NTpzENS1H/RwSSC7TVzvlqmQ=="."NESTED_TABLE_ID"="SYS_NTnN5b8Q+8Txi9V
                  w5Ysl6x9w=="."SYS_NC0000600007$")
    Note
       - dynamic sampling used for this statementCLEAN UP...
    DROP TABLE CUST_ORDER_TBL purge;
    exec dbms_xmlschema.deleteschema('http://xmlns.example.org/xsd/testcase.xsd');

  • XSLT to convert XML into Tables

    Hi,
    I'm trying to import my XML data into a table format. After adding an XSL file to my Structure Application as a Preprocessing Stylesheet, and importing my XML instance file with the Template file opened, the "Unknown File Type" error window appeared asking for a file format to Convert From. Picking any one doesn't create a table.
    The XSL file tranforms the XML data into an HTML file that has a table with columns corresponding to the XML data. I was thinking using that type of XSL because it renders tables.
    Below is the XSL markup:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
      <html>
      <body>
      <h2>Products</h2>
        <table border="1">
          <tr bgcolor="#9acd32">
            <th>Title</th>
            <th>Number</th>
            <th>Date</th>
          </tr>
          <xsl:for-each select="Products/Product">
          <tr>
            <td><xsl:value-of select="Title"/></td>
            <td><xsl:value-of select="Number"/></td>
            <td><xsl:value-of select="Date"/></td>
          </tr>
          </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>
    </xsl:stylesheet>
    Title, Number, and Date are child elements of the Product element, which is a child element of the Products root element in my XML file.
    Am I applying the stylesheet correctly here? Am I using the write kind of stylesheet?
    Thanks,
    zeb

    Hi Michael, Van,
    Thank you for responding to my post. Your feedback was very helpful!
    I was able to get the table to generate in FrameMaker but no data from the XML file is flowing into it. All that appears is the header row with "Title," "Number," and "Date" in the cells, and a row with blank cells underneath it. The Structure View pane has a red "<no value>" for the "Cols" and "Widths" attributes of the Table element. Only the Title column is affected by the width value.
    The XSL, RW, and EDD files are as a follows: (The structure for the XML is a "Products" root element with mulitple "Product" child elements that each have a "Title," "Name," "Date" child element.)
    ==========================XSL==================
    <xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" doctype-system="products_DTD3.dtd" />
    <xsl:template match="/">
    <products>
    <Table cols="3" width="150">
    <TableHeading>
        <TableRow>
            <TableCell>Title</TableCell>
            <TableCell>Number</TableCell>
            <TableCell>Date</TableCell>
        </TableRow>
    </TableHeading>
    <TableBody>
    <TableRow>
    <TableCell><xsl:for-each select="Products/Product"><xsl:value-of select="Title"/></xsl:for-each></TableCell>
    <TableCell><xsl:for-each select="Products/Product"><xsl:value-of select="Number"/></xsl:for-each></TableCell>
    <TableCell><xsl:for-each select="Products/Product"><xsl:value-of select="Date"/></xsl:for-each></TableCell>
    </TableRow>
    </TableBody>
    </Table>
    </products>
    </xsl:template>
    </xsl:stylesheet>
    ==========================EDD==================
    Element (Container): products
    General rule:    Table
    Valid as the highest-level element.
    Element (Table): Table
    General rule:    TableHeading,TableBody
    Attribute list
    Name: cols     String     Required
    Name: width     String     Required
    Element (Table Heading): TableHeading
    General rule:    TableRow
    Element (Table Row): TableRow
    General rule:    TableCell+
    Element (Table Cell): TableCell
    General rule:    <TEXT>
    Element (Table Body): TableBody
    General rule:    TableRow
    ==========================RW===================
    fm version is "10.0";
    element "Table" {
      is fm table element;
      attribute "cols" is fm property columns;
      attribute "width" is fm property column widths;
    element "TableRow" is fm table row element;
    element "TableHeading" is fm table heading element;
    element "TableBody" is fm table body element;
    element "TableCell" is fm table cell element;
    ===============================================
    I'm having trouble placing the "<xsl:for-each select="Products/Product">" tag in the XSL file. When I put it under  TRow, FrameMaker  gives an error that "TRow is not a valid for content (TCell)+". Only when I place it within the TCell tags (as I have above) does the above-mentioned Table with a Header row and a row with empty cells generate.
    Is the XSL the problem here?
    Thanks,
    Zeb

  • XML into table: Why do all my insert values are NULL?

    Hello,
    I'm pretty new in XML ... then I still learn a lot by myself !!!
    I surfed to a lot of forums and examples ....
    I have a XML file. I built a XSL file in order to insert a part of my XML file into a table.
    The 2 files are loaded as CLOB into a DB table.
    I wrote a PLSQL procedure for this job.
    We are on a DB 10gR2.
    As a result, all the inserted columns are loaded with NULL !!!! ....
    I must have done something wrong ... for sure !!! but I cannot figure out.
    Here are the files and procedures:
    *<?xml version="1.0" ?>*
    *<purchaseOrder orderDate="1999-10-20">*
    *<shipTo country="US">*
    *<name>Alice Smith</name>*
    *<street>123 Maple Street</street>*
    *<city>Mill Valley</city>*
    *<state>CA</state>*
    *<zip>90952</zip>*
    *</shipTo>*
    *<billTo country="US">*
    *<name>Robert Smith</name>*
    *<street>8 Oak Avenue</street>*
    *<city>Old Town</city>*
    *<state>PA</state>*
    *<zip>95819</zip>*
    *</billTo>*
    *<comment>Hurry, my lawn is going wild!</comment>*
    *<items>*
    *<item partNum="872-AA">*
    *<productName>Lawnmower</productName>*
    *<quantity>1</quantity>*
    *<USPrice>148.95</USPrice>*
    *<comment>Confirm this is electric</comment>*
    *</item>*
    *<item partNum="926-AA">*
    *<productName>Baby Monitor</productName>*
    *<quantity>1</quantity>*
    *<USPrice>39.98</USPrice>*
    *<shipDate>1999-05-21</shipDate>*
    *</item>*
    *</items>*
    *</purchaseOrder>*
    The XLS file is :
    *<?xml version="1.0"?>*
    *<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">*
    *<xsl:output method="xml" media-type="text/xml" />*
    *<xsl:template match="/">*
    *<insert>*
    *<Table>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_club'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<Columns>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_code'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_name'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_price'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *</Column>*
    *</Columns>*
    *<xsl:for-each select="purchaseOrder/items">*
    *<Rowset>*
    *<xsl:for-each select="item">*
    *<Row>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_code'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<xsl:value-of select="@partNum" />*
    *<!--layer=Default-->*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_name'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<xsl:value-of select="productName" />*
    *<!--layer=Default-->*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_price'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<xsl:value-of select="USPrice" />*
    *<!--layer=Default-->*
    *</Column>*
    *</Row>*
    *</xsl:for-each>*
    *<!--layer=Default-->*
    *</Rowset>*
    *</xsl:for-each>*
    *<!--layer=Default-->*
    *</Table>*
    *</insert>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    *<!--xsl-easyControl - (C) 2003-2007 SoftProject GmbH-->*
    *<!--Source: "purchaseOrder_clubDev.xml"|Type:"xml"-->*
    *<!--Destination: "Connexion_XSL_SCFOX.xac"|Type:"Connexion_XSL_SCFOX"-->*
    *<!--Document type: Input Driven-->*
    The XML files are successfully inserted into a CLOB colum :
    ID FILENAME XML
    24 item_club.xsl <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.or
    25 purchaseOrder.xml <?xml version="1.0" ?> <purchaseOrder orderDate="1999-10-20">
    And the procedure is :
    CREATE OR REPLACE PROCEDURE load_xml( p_dir IN VARCHAR2
    , p_filename IN VARCHAR2) AS
    insCtx DBMS_XMLSave.ctxType;
    rows NUMBER;
    l_bfile BFILE := BFILENAME(p_dir, p_filename);
    l_clob CLOB;
    l_bfile_xsl BFILE;
    l_clob_xsl CLOB;
    begin
         dbms_output.put_line('p_filename='||p_filename);
         insCtx := DBMS_XMLSave.newContext('sipmo.item_club'); -- get the save context..!
         dbms_output.put_line('item_club.xsl context='||insCtx);
         --IMPORTANT... ignore la casse
         DBMS_XMLSave.setIgnoreCase(insCtx, 1);
         --select XSL file item_club.xsl
    l_bfile_xsl := BFILENAME(p_dir, 'item_club.xsl');
         DBMS_LOB.createtemporary (l_clob_xsl, TRUE);
         DBMS_LOB.fileopen( l_bfile_xsl, DBMS_LOB.file_readonly);
         DBMS_LOB.loadfromfile( l_clob_xsl, l_bfile_xsl, DBMS_LOB.getlength(l_bfile_xsl));
         dbms_output.put_line('item_club.xsl length='||DBMS_LOB.getlength(l_bfile_xsl));
         DBMS_LOB.fileclose(l_bfile_xsl);
         DBMS_XMLSave.SETXSLT(insCtx, l_clob_xsl);
         dbms_output.put_line('step 10');
         DBMS_XMLSave.clearUpdateColumnList(insCtx); -- clear the update settings
         DBMS_XMLSave.setUpdateColumn(insCtx,'ITEM_CODE');
         DBMS_XMLSave.setUpdateColumn(insCtx,'ITEM_NAME');
         DBMS_XMLSave.setUpdateColumn(insCtx,'ITEM_PRICE');
         -- Now insert into the table
         dbms_output.put_line('step 90');
         rows := DBMS_XMLSave.insertXML(insCtx, l_clob);
         dbms_output.put_line('step 100 rows='||rows);
         DBMS_XMLSave.closeContext(insCtx);
         DBMS_LOB.freetemporary (l_clob_xsl);
         DBMS_LOB.freetemporary (l_clob);
    END;
    The result table is like this :
    scfx>select * from item_club;
    ITEM_CODE ITEM_NAME ITEM_PRICE
    All the columns of each row are NULL !!!
    Why?
    Do you have any advice ?
    Thanks if advance,
    Olivier

    So, if I understand what you mean ... I should write something like this :
         insert into item_club
              select t2.partnum, t2.productname, to_number(replace(t2.usprice, '.', ','))
              from odab_xml_tab t
              , xmltable('*' passing t.xml.extract('purchaseOrder/items/*')
              columns partNum varchar2(35) path '@partNum'
              , productName varchar2(35) path 'productName'
              , USPrice varchar2(35) path 'USPrice'
              ) t2
    Its a change in our code.. but that looks nice !!!
    Thanks,
    Olivier

  • Ain't getting it: insert into table by determing value from another table

    I have a table (PERCENTILE_CHART) with percentiles and test scores for different tests:
    Structure:
    Percentile, Reading_Test, Writing_Test
    Data:
    30,400,520
    31,450,560
    97,630,750
    98,630,780
    99,640,800
    The data is currently in ascending order by Percentile.
    If a person took the Reading test and scored 630 he or she would be in the 98th (not 97th) percentile of the class taking that test.
    I wrote a statement to return the percentile:
    select Percentile
    from ( select ROWNUM, PERCENTILE
    from PERCENTILE_CHART
    where READING_TEST <= '650'
    order by READING_TEST desc)
    where ROWNUM < 2 order by PERCENTILE desc;
    This select works and is able to determine the highest percentile for a score.
    Ok, now I want to process all the records in a STUDENT table which have
    test scores and insert them in a new table along with the percents, normalizing the data in the process.
    Have this:
    STUDENT:
    Student_Name,Student_ID,
    John Smith,121,Reading,98,Writing,90
    Maggie Smithe,122,Reading,95,Writing,96
    And needs to be moved to into SCORES with the percentiles, so I get this:
    SCORES:
    Student_Name,Student_ID,Test_Name,Percentile
    121,Reading,98
    121,Writing,90
    122,Reading,95
    122,Writing,96
    This is were I get confused. How do I insert the data into the SCORES table with the percentile? I think calling a function in package is the way to do it:
    function oua_Test_Percentile_f (
    p_Test_Name in char,
    p_Test_Value in char)
    return char as
    -- Declare variables
    c_Return_PTile char(2);
    begin
    select PERCENTILE into c_Return_PTile
    from (select ROWNUM, PERCENTILE
    from PERCENTILE_CHART
    where p_Test_Name <= '&p_Value'
    order by p_Test_Nmae desc)
    where ROWNUM < 2 order by PERCENTILE desc;
    return c_Return_PTile;
    end;
    But this function doesn't return the percentile even though it is based on my working select mentioned earlier. It returns a blank for all tests.
    And even if it is working how do I then populate the SCORES table?

    You may want to use analytical functions so that you can determine the percentile across all of the different scores:
    SQL> with
    2 PERCENTILE_CHART as
    3 (
    4 select 30 PERCENTILE, 400 READING_TEST, 520 WRITING_TEST from dual union all
    5 select 31 PERCENTILE, 450 READING_TEST, 560 WRITING_TEST from dual union all
    6 select 97 PERCENTILE, 630 READING_TEST, 750 WRITING_TEST from dual union all
    7 select 98 PERCENTILE, 630 READING_TEST, 780 WRITING_TEST from dual union all
    8 select 99 PERCENTILE, 640 READING_TEST, 800 WRITING_TEST from dual
    9 )
    10 select
    11 max(percentile) over (partition by reading_test) HIGHEST_READING,
    12 max(percentile) over (partition by writing_test) HIGHEST_WRITING,
    13 percentile_chart.*
    14 from
    15 percentile_chart
    16 /
    HIGHEST_READING HIGHEST_WRITING PERCENTILE READING_TEST WRITING_TEST
    30 30 30 400 520
    31 31 31 450 560
    98 97 97 630 750
    98 98 98 630 780
    99 99 99 640 800
    SQL>
    I wasn't exactly sure how you wantd to coorelate this to the student records though; the student table had only two column name headings but there were four rows listed as examples and had fewer rows than in the percentile_chart table...
    If you join the student table to the able query it might be what you are looking for.
    You can create another table based on the output of your query by doing:
    create table scores
    as select * from
    (insert your query here)
    /

  • Load XML into Table

    Hi All,
    I want to create a procedure in which , I provide table name and XML file location, The procedure goes at that location and pick XML file and load in to the table. Can this is possible ??
    Thanks
    Best Regards,
    Adil

    The following code very interesting.
    DROP TABLE TBL_TEST
    CREATE TABLE "TBL_TEST"
    (     "N" NUMBER,
    "V" VARCHAR2(20),
         "D" DATE)
    CREATE OR REPLACE DIRECTORY XML_DIR AS 'C:\XMLDIR';
    CREATE OR REPLACE
    PROCEDURE INSERT_XML_TBL_TEST(p_directory in varchar2,
    p_filename in varchar2)
    --p_tableName in varchar2 DEFAULT 'TBL_TEST')
    AS
    insCtx DBMS_XMLSTORE.CTXTYPE;
    rows NUMBER;
    xmlDoc CLOB := null;
    BEGIN
    if (dbms_xdb.existsResource('/public/'||lower(p_filename))) then
    dbms_xdb.deleteResource('/public/'||lower(p_filename));
    end if;
    v_return := DBMS_XDB.CREATERESOURCE(abspath => '/public/'||lower(p_filename),
    data => BFILENAME(UPPER(p_directory),LOWER(p_filename)));
    COMMIT;
    SELECT RV.RES.GETCLOBVAL()
    INTO xmldoc
    FROM RESOURCE_VIEW RV WHERE ANY_PATH = '/public/'||lower(p_filename);
    insCtx := DBMS_XMLSTORE.newcontext('TBL_TEST');
    dbms_xmlstore.SetRowTag(insctx,'TBL_TEST_ROW');
    dbms_xmlstore.clearkeycolumnlist(insctx);
    dbms_xmlstore.setupdatecolumn(insctx,'N');
    dbms_xmlstore.setupdatecolumn(insctx,'V');
    dbms_xmlstore.setupdatecolumn(insctx,'D');
    rows := dbms_xmlstore.insertxml(insctx, xmldoc);
    dbms_output.put_line(rows ||' rows inserted');
    dbms_xmlstore.closecontext(insctx);
    END;
    select * from tbl_test
    begin
    INSERT_XML_TBL_TEST('XML_DIR','tbl_test.xml');
    end;
    and I created XMLDIR folder on C:\
    and there have a xml file name is tbl_test.xml and content this file is
    <TBL_TEST_ROWSET>
    <TBL_TEST_ROW num="1">
    <N>11</N>
    <V>Testing 11</V>
    </TBL_TEST_ROW>
    <TBL_TEST_ROW num="2">
    <N>10</N>
    <V>Testing 11</V>
    </TBL_TEST_ROW>
    </TBL_TEST_ROWSET>
    Mahir M. Quluzade
    Edited by: Mahir M. Quluzade on Nov 24, 2010 11:47 AM

  • Can't Figure Out How To Import XML into a Table?

    HELP!
    I've been using InDesign for several years now... but everything Ive ever done has been basic one off layout concepts.
    I am working on a website for a musical theater actress and for her resume, Id like to make a PDF which lists in table format the show, theatre and role she had for each job.
    I could do this manually... but Id really like to learn how to just reuse the same XML data that I have for her website and import it into InDesign.
    I have looked at Adobe's help file, I have scoured the internet, and I still can't figure it out... I have done like the adobe support file says... and I cant seem to get the values I create in her resume xml file to show up in a table I create in InDesign.
    I even tried to simplify it for the learning process and did something as basic as an XML file that has 5 colors... couldnt even get that working.
    So could someone explain it to me like Im a 5 year old... how to take a XML file, import it, place it in a table and have the data actually show up in the table.
    thanks,
    brian

    Are you sure you want to use XML with tables for this? No doubt importing XML into tables is useful for some specialized tasks, such as importing formatting information inside the XML itself, but for most of the familiar tasks that XML excels at, tables are neither necessary nor useful.
    In my (limited) experience, if the XML elements are well-differentiated, by which I mean different types of data have their own distinctive tags, then the special powers of XML can be exploited more fully using the more familiar tagged text, nested tags etc. in ordinary text frames using paragraph breaks, tab characters, etc. to achieve a suitably "tabular" finished appearance.
    If you must import XML into tables, I recommend Adobe's own PDF "Adobe InDesign CS3 and XML: A Technical Reference" availabe here:
    http://www.adobe.com/designcenter/indesign/articles/indcs3ip_xmlrules.pdf
    It sounds very daunting -- the words "technical reference" make me shudder -- but actually it's very readable and not very technical at all. Some nice pics and everything!
    Jeremy

  • How to import XML into SQL Table

    Dear all,
    There are a lot of books about exporting data into XML format.
    Actually, how to use XML Documents? Sorry I am new that I ask such a question.
    What i think may be exchange or save data using xml. If so, How to import into MS SQL table? Do it need to do any mapping?
    Appreciate for your hints

    Are you sure you want to use XML with tables for this? No doubt importing XML into tables is useful for some specialized tasks, such as importing formatting information inside the XML itself, but for most of the familiar tasks that XML excels at, tables are neither necessary nor useful.
    In my (limited) experience, if the XML elements are well-differentiated, by which I mean different types of data have their own distinctive tags, then the special powers of XML can be exploited more fully using the more familiar tagged text, nested tags etc. in ordinary text frames using paragraph breaks, tab characters, etc. to achieve a suitably "tabular" finished appearance.
    If you must import XML into tables, I recommend Adobe's own PDF "Adobe InDesign CS3 and XML: A Technical Reference" availabe here:
    http://www.adobe.com/designcenter/indesign/articles/indcs3ip_xmlrules.pdf
    It sounds very daunting -- the words "technical reference" make me shudder -- but actually it's very readable and not very technical at all. Some nice pics and everything!
    Jeremy

  • Workflow for exporting xml from Excel and importing into table in InDesign

    Hello,
    I have worked out how to get data from a .xlsx into a table in InDesign. However, the workflow is still a little clunky and I am looking for way to automate the process further. My current workflow is as follows (files can be download here: http://visual360.co.uk/xml.zip)
    xml is exported from .xlsx by mapping the schema (see what_I_get.xml)
    assign tags to table and individual cells in InDesign
    This is the clunky bit: edit the what_I_get.xml to:
    remove the indentation (this seems necessary as otherwise when I get to stage 4, all the imported text is also indented)
    add tag for table in InDesign (p10_table)
    add tags for individual cells (p10_c11 etc.)
    import the produced what_I_want.xml in the structure panel of InDesign.
    Can anyone point me in the direction of how to automate step 3 above?
    Thanks in advance,
    Nick

    Hi Mike,
    Thanks very much for the reply. I am not at all familiar with XSL/XSLT. I have given it a quick google and it seems like it could be quite a steep learning curve to master. Maybe if I explain the whole context here, it may allow you to point me in the direction of a tutorial that provides a step by step approach to achieve my final goal. Alternatively, you may be able to suggest a whole new workflow.
    I am in the process of updating this document: http://www.ncl.ac.uk/students/insessional/assets/documents/IS_Brochure_2014-15.pdf
    The tables on pages 10-21 contain lots and lots of repeated information. We want the layout to in this format so that each group of students has all the information relevant to them on a single double spread. However, the challenge of using this approach is that it is very high maintenance to ensure the duplicated information is kept in sync - even using a copy / paste approach.
    I was hoping to overcome this by using a single source of data (eg. a spreadsheet) which would then feed into the InDesign. This workflow seems to be overcomplicated by the apparent need to use xml as the "middle-man".
    Ideally, I would like to press the export button in Excel and get this information into the the correct cells in the tables on pages 10-21 without a significant amount of manual labour - after all, my reasons for investigating an automated approach in the first place was to avoid the manual entering of data ie. the scope for error...
    An alternative approach maybe to skip Excel altogether and just use .xml. However, I am not sure that this is possible as Indesign only seems to allow you to import each element once. Maybe you could correct me here...
    I am happy to invest a certain amount of time in developing this approach as once it is in place, it will save a huge of proof-reading time year after year, especially as inconsistencies still persist despite our best efforts to weed them out.
    If you could let me know your thoughts on this and maybe identify a tutorial that would help me, I would be extremely grateful.
    Thanks again!
    Nick

  • Loading this xml data into tables

    Hello,
    I am having a problem loading this XML file into tables. The xml file structure is
    <FILE>
    <ACCESSION>
    some ids
    <INSTANCE>
    some data
    <VARIATION
    </VARIATION>
    <VARIATION>
    </VARIATION> variation gets repeated a number of times
    <ASSEMBLY>
    </ASSEMBLY>
    <ASSEMBLY>
    </ASSEMBLY> Assembly gets repeated a number of times.
    </INSTANCE>
    </ACCESSION>
    </FILE>
    I created a table which has the structure:
    create table accession(
    accession_id varchar2(20),
    Instance instance_type);
    create or replace type instance_type as object
    (method varchar2(20),
    class varchar2(20),
    source varchar2(20),
    num_char number(10),
    variation variation_type,
    assembly assembly_type)
    create or replace type variation_type as object
    (value varchar2(2),
    count number(10),
    frequency number(10),
    pop_id varchar2(10)
    Created a similiar type for assembly.
    When I load it, I could only store the first variation data but not the subsequent ones. Similarly for assembly I could only store the first data but not the subsequent ones.
    Could anyone let me know how I could store this data into tables? I have also included a sample XML file in this message.
    Thank You for your help.
    Rama.
    Here is the sample xml file.
    <?xml version="1.0" ?>
    - <FILE>
    - <ACCESSION>
    <ACCESSION_ID>accid1</ACCESSION_ID>
    - <INSTANCE>
    <METHOD>method1</METHOD>
    <CLASS>class1</CLASS>
    <SOURCE>source1</SOURCE>
    <NUM_CHAR>40</NUM_CHAR>
    - <VARIATION>
    <VALUE>G</VALUE>
    <COUNT>5</COUNT>
    <FREQUENCY>66</FREQUENCY>
    <POP1>pop1</POP1>
    <POP2>pop1</POP2>
    </VARIATION>
    <VARIATION>
    <VALUE>C</VALUE>
    <COUNT>2</COUNT>
    <FREQUENCY>33</FREQUENCY>
    <POP_ID1>pop2</POP_ID1>
    </VARIATION>
    - <ASSEMBLY>
    <ASSEMBLY_ID>1</ASSEMBLY_ID>
    <BEGIN>180</BEGIN>
    <END>180</END>
    <TYPE>2</TYPE>
    <ORI>-</ORI>
    <OFFSET>0</OFFSET>
    </ASSEMBLY>
    - <ASSEMBLY>
    <ASSEMBLY_ID>2</ASSEMBLY_ID>
    <BEGIN>235</BEGIN>
    <END>235</END>
    <TYPE>2</TYPE>
    <ORI>-</ORI>
    <OFFSET>0</OFFSET>
    </ASSEMBLY>
    </INSTANCE>
    </ACCESSION>
    </FILE>

    Hello,
    I could figure out how to load this XML file by using cast(multiset(
    So never mind.
    Thank You.
    Rama.

  • System getting hanged whilst using Insert into table select * from table

    I have a peculiar problem.
    I am using the below statements:
    Query 1:
    insert into table ppms.erin_out@ppms_dblink select * from erin_out;
    Query 2:
    insert into table ppms.erin_out@ppms_dblink values(23,'dffgg',12',dfdfdgg,dfdfdg);
    I am in 'interfaces' schema (testing server) and executing above statements. We have testing server and development server, both are identical, i.e one is clone of the other.
    ppms_dblink is created in interfaces schema. ppms_dblink points to different database server which has two schemas 'clarity' and 'ppms'. ppms_dblink is create through authentication details of clarity schema.
    erin_out table is created on ppms schema on the same dababase server pointed by ppms_dblink.
    Question is :
    TOAD hangs while running query 1.
    Query 2 is working perfectly.
    As I have pl/sql script which is using query 1. I want to know why query 1 is creating problem.
    If I use query 2 in my pl/sql query then it may create performance issue as i have to use cursor then.
    On clarity schema, I have insert, update, select, modify rights on ppms.erin_out.
    I have tried same queries from another database server.
    That is I tried queries from 'interfaces' schema of development server ( clone of the testing server ). Its working perfectly.
    Message was edited by:
    user484158

    Dhanchik:
    The table from which I select rows, to insert into table on dblink, is having only one record. It may contatin maximum 100 rows at a time because I am scheduling the procedure through daemon process. Anyway transaction is not more than 100 records. I am trying with just 1 record for testing.
    So 1) Problem is not about the cost, TOAD is getting hanged ( to insert 1 record, cost does not mean much)
    2) there is no large amount of data, so no question of deteriorated performance
    Aron Tunzi:
    I think that should not be problem, because I am able to insert a record through query 2.
    Warren Tolentino :
    I am testing with 1 record only. Its not performance issue.
    Message was edited by:
    &#2352;&#2330;&#2367;&#2340;

  • Inserting XML String into Table with help of Stored Proc

    I will be getting XML String from JAVA, which I have to insert in Table A, XML String is as follows
    <?xml version = '1.0'?>
    < TableA>
    <mappings Record="3">
    < MESSAGEID >1</ MESSAGEID >
    < MESSAGE >This  is available at your address!</ MESSAGE>
    </mappings>
    <mappings Record="3">
    < MESSAGEID >2</ MESSAGEID>
    < MESSAGE >This isn’t available at your address. </ MESSAGE>
    </mappings>
    </ TableA >
    Table Structure*
    MESSAGEID     VARCHAR2(15 BYTE)
    MESSAGE     VARCHAR2(500 BYTE)
    This is the stored procedure which I have written to insert data into TableA, V_MESSAGE will be input parameter for inserting XML String 
    create or replace procedure   AP_DBI_PS_MESSAGE_INSERT
    V_MESSAGE VARCHAR2(1024)
    AS
    declare
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    V_FILEHANDLE UTL_FILE.FILE_TYPE;
    begin
    -- the name of the table as specified in our DTD
    xmlgen.setRowsetTag('TableA');
    -- the name of the data set as specified in our DTD
    xmlgen.setRowTag('mappings');
    -- for getting the output on the screen
    dbms_output.enable(1000000);
    -- open the XML document in read only mode
    v_FileHandle := utl_file.fopen(V_MESSAGE);
    --v_FileHandle := V_MESSAGE;
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    -- for inserting the XML data into the table
    rowsp := xmlgen.insertXML('ONE.TableA',finalStr);
    dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
    xmlgen.resetOptions;
    end;Please Help
    Edited by: 846857 on Jul 18, 2011 10:55 PM

    with t as (select xmltype('<TableA >
                               <mappings Record="3">
                               <MessageId>1</MessageId>
                               <Message> This bundle is available at your address!</Message>
                               </mappings>
                               <mappings Record="3">
                               <MessageId>2</MessageId>
                               <Message>This isn’t available at your address. </Message>
                               </mappings>
                               </TableA  >') col FROM dual)
      --End Of sample data creation with subquery factoring.
      --You can use the query from here with your table and column name.
    select EXTRACTVALUE(X1.column_value,'/mappings/MessageId') MESSAGEID
          ,EXTRACTVALUE(X1.column_value,'/mappings/Message') MESSAGE
    from t,table(XMLSEQUENCE(extract(t.COL,'/TableA/mappings'))) X1;Above Code works as i get result
    MESSAGEID     MESSAGE
    1             This bundle is available at your address!
    2             This isn’t available at your address.
    _____________________________________________ now I want to insert the result into Table A... How to proceed... Please help
    Edited by: 846857 on Jul 19, 2011 12:15 AM

  • Help needed badly Insert text data from xml files into tables

    Hi all, I have asked to do insertion of text from a xml file into tables upon receiving using pro*c. i've done quite an amount of research on xml parser in c but there wasn't much information for mi to use for implementation...
    Guys don't mind helping me to clarify few doubts of mine...
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?
    2. Is there any tutorials or help files for xml parser libs where i can read up?
    I need the xml parser to recognise the tags, followed by recognising the text after the tags.
    eg. xml format
    <studentID> 0012 </studentID>
    <student> john </student>
    <studentID> 0013 </studentID>
    <student> mary </student>
    text willl be inserted into tables like this:
    studentID | student
    0012 | john
    0013 | mary
    by the way i'm using oracle 8i on HP-UX. Thanks in advance.

    I can answer one of of your questions at least
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?You need the XML XDK. You can use http://www.oracle.com/technology/tech/xml/xdkhome.html as your starting point. I believe the 9i version works for 8i.
    I have no pro*c experience so I can't offer any other suggestions regarding how to do this in pro*c.

  • Error occured while inserting XML file data into table.

    Hello,
    I m trying to load xml data into table by following code.but getting below error
    Error at line 1
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00222: error received from SAX callback function
    ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
    ORA-06512: at line 21
    DECLARE
      xmldoc   clob;
      insCtx   DBMS_XMLStore.ctxType;
      dname    varchar2(20) := 'MDIR';
      rows  number;
    BEGIN
        xmldoc := dbms_xslprocessor.read2clob(dname, 'try_xm3.xml');
        insCtx := DBMS_XMLStore.newContext('try1');
    dbms_output.put_line('1');
        DBMS_XMLStore.setRowTag(insCtx, 'cajas');
    rows := DBMS_XMLStore.insertXML(insCtx, xmlDoc);
    commit;
      dbms_output.put_line('INSERT DONE '||TO_CHAR(rows));
      DBMS_XMLStore.closeContext(insCtx);
    END;
    <?xml version="1.0" encoding="utf-8"?>
    <cajas xmlns="PBcion.Caja" fec="2011-03-02T14:20:14" codDeleg="093">
      <caj codPrev="80001223" fechaInicio="2011-03-02" fec="2011-09-02" couta="01" idPerio="1" caj="32"></caj>
    </cajas>can you please look into this?
    I m using oracle 10g

    SQL> create table try1
      2  (
      3  codPrev number,
      4  fechaInicio varchar2(25),
      5  fec varchar2(25),
      6  couta number,
      7  idPerio number,
      8  caj number
      9  );
    Table created
    SQL>
    SQL> insert into try1 (codprev, fechainicio, fec, couta, idperio, caj)
      2  select x.codprev, x.fechainicio, x.fec, x.couta, x.idperio, x.caj
      3  from xmltable(
      4         xmlnamespaces(default 'PBcion.Caja')
      5       , '/cajas/caj'
      6         passing xmltype(bfilename('TEST_DIR','try_xm3.xml'), nls_charset_id('AL32UTF8'))
      7         columns codPrev     number       path '@codPrev'
      8               , fechaInicio varchar2(25) path '@fechaInicio'
      9               , fec         varchar2(25) path '@fec'
    10               , couta       number       path '@couta'
    11               , idPerio     number       path '@idPerio'
    12               , caj         number       path '@caj'
    13       ) x
    14  ;
    1 row inserted
    SQL> select * from try1;
       CODPREV FECHAINICIO               FEC                            COUTA    IDPERIO        CAJ
      80001223 2011-03-02                2011-09-02                         1          1         32
    Since the two date attributes are coming in the W3C's xs:date format, you can directly define the corresponding columns as DATE and use a DATE projection in XMLTable :
    SQL> alter table try1 modify (fechainicio date);
    Table altered
    SQL> alter table try1 modify (fec date);
    Table altered
    SQL>
    SQL> insert into try1 (codprev, fechainicio, fec, couta, idperio, caj)
      2  select x.codprev, x.fechainicio, x.fec, x.couta, x.idperio, x.caj
      3  from xmltable(
      4         xmlnamespaces(default 'PBcion.Caja')
      5       , '/cajas/caj'
      6         passing xmltype(bfilename('TEST_DIR','try_xm3.xml'), nls_charset_id('AL32UTF8'))
      7         columns codPrev     number       path '@codPrev'
      8               , fechaInicio date         path '@fechaInicio'
      9               , fec         date         path '@fec'
    10               , couta       number       path '@couta'
    11               , idPerio     number       path '@idPerio'
    12               , caj         number       path '@caj'
    13       ) x
    14  ;
    1 row inserted
    SQL> select * from try1;
       CODPREV FECHAINICIO FEC              COUTA    IDPERIO        CAJ
      80001223 02/03/2011  02/09/2011           1          1         32

  • Xml data upload into tables using loader

    Hi,
    I have to load XML file data into multiple tables using sqlloader. i wrote a cotrol file to execute this ,but i was not able to load the data into multiple tables at the same time, first loading table in control file is able to load the data ,rest of the load is giving error,please refer the below control file and log. Help me with your great efforts.
    Have a great day!
    Control file:
    LOAD DATA
    TRUNCATE
    INTO TABLE Derivative_Security
    WHEN DERIVATIVESECURITYID != ' '
    FIELDS TERMINATED BY '</DerivativeSecurity>' optionally enclosed by '"'
    TRAILING NULLCOLS
    DUMMY1 filler char(50000) Terminated by '<DerivativeSecurity ',
    DUMMY2 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157Level="' and '"',
    DUMMY3 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157MVAdjustable="' and '"',
    DUMMY4 filler char(200) Terminated by WHITESPACE enclosed by 'OriginalMV="' and '"',
    DUMMY5 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157MVDelta="' and '"',
    DUMMY6 filler char(200) Terminated by WHITESPACE enclosed by 'FAS157AdjustedMV="' and '"',
    DUMMY7 filler char(200) Terminated by WHITESPACE enclosed by 'PLCurrency="' and '"',
    DERIVATIVESECURITYID Terminated by WHITESPACE enclosed by 'DerivativeSecurityID="' and '"',
    METDERIVATIVEID Terminated by WHITESPACE enclosed by 'MetDerivativeID="' and '"',
    MUREXTRANSNUMBER Terminated by WHITESPACE enclosed by 'MurexTransactionNumber="' and '"',
    DUMMY8 filler char(200) Terminated by WHITESPACE enclosed by 'Trader="' and '"',
    DUMMY9 filler char(200) Terminated by WHITESPACE enclosed by 'BuySell="' and '"',
    DETAILTYPE Terminated by WHITESPACE enclosed by 'DetailType="' and '"',
    DERIVATIVETYPE Terminated by WHITESPACE enclosed by 'DerivativeType="' and '"',
    AL_MANAGEMENTSIDE Terminated by WHITESPACE enclosed by 'AL_ManagementSide="' and '"',
    COUNTERPARTYCODE Terminated by WHITESPACE enclosed by 'CounterpartyCode="' and '"',
    COUNTERPARTYNAME Terminated by WHITESPACE enclosed by 'CounterpartyName="' and '"',
    CURRENCYCODE Terminated by WHITESPACE enclosed by 'CurrencyCode="' and '"',
    DUMMY10 filler char(200) Terminated by WHITESPACE enclosed by 'Coupon="' and '"',
    DUMMY11 filler char(200) Terminated by WHITESPACE enclosed by 'FixedFloatingIndicator="' and '"',
    DUMMY12 filler char(200) Terminated by WHITESPACE enclosed by 'IndexMultiplier="' and '"',
    DUMMY13 filler char(200) Terminated by WHITESPACE enclosed by 'IndexName="' and '"',
    DUMMY42 filler char(200) Terminated by WHITESPACE enclosed by 'Margin="' and '"',
    DUMMY14 filler char(200) Terminated by WHITESPACE enclosed by 'Comment11="' and '"',
    DUMMY15 filler char(200) Terminated by WHITESPACE enclosed by 'Comment12="' and '"',
    DUMMY16 filler char(200) Terminated by WHITESPACE enclosed by 'Comment13="' and '"',
    DUMMY17 filler char(200) Terminated by WHITESPACE enclosed by 'Comment21="' and '"',
    DUMMY18 filler char(200) Terminated by WHITESPACE enclosed by 'Comment22="' and '"',
    DUMMY19 filler char(200) Terminated by WHITESPACE enclosed by 'Comment23="' and '"',
    DUMMY20 filler char(2000) Terminated by WHITESPACE enclosed by 'TradeComment="' and '"',
    DUMMY21 filler char(200) Terminated by WHITESPACE enclosed by 'OptionCallPut="' and '"',
    DUMMY22 filler char(200) Terminated by WHITESPACE enclosed by 'OptionType="' and '"',
    DUMMY23 filler char(200) Terminated by WHITESPACE enclosed by 'SettleType="' and '"',
    DUMMY24 filler char(200) Terminated by WHITESPACE enclosed by 'RefISIN="' and '"',
    DUMMY25 filler char(200) Terminated by WHITESPACE enclosed by 'RefObligation="' and '"',
    DUMMY26 filler char(200) Terminated by WHITESPACE enclosed by 'Sensitivity="' and '"',
    DUMMY27 filler char(200) Terminated by WHITESPACE enclosed by 'EffectiveConvexity="' and '"',
    DUMMY28 filler char(200) Terminated by WHITESPACE enclosed by 'Vega="' and '"',
    DUMMY29 filler char(200) Terminated by WHITESPACE enclosed by 'NextResetDate="' and '"',
    DUMMY30 filler char(200) Terminated by WHITESPACE enclosed by 'LastResetDate="' and '"',
    EFFECTIVEDURATION Terminated by WHITESPACE enclosed by 'EffectiveDuration="' and '"',
    DUMMY31 filler char(200) Terminated by WHITESPACE enclosed by 'Instrument="' and '"',
    DUMMY32 filler char(200) Terminated by WHITESPACE enclosed by 'IssuerCode="' and '"',
    DUMMY33 filler char(200) Terminated by WHITESPACE enclosed by 'IssuerName="' and '"',
    DUMMY34 filler char(200) Terminated by WHITESPACE enclosed by 'IssuerREDCode="' and '"',
    DUMMY35 filler char(200) Terminated by WHITESPACE enclosed by 'Strategy="' and '"',
    DUMMY36 filler char(200) Terminated by WHITESPACE enclosed by 'StrikePrice="' and '"',
    MATURITYDATE Terminated by WHITESPACE enclosed by 'MaturityDate="' and '"',
    DUMMY37 filler char(200) Terminated by WHITESPACE enclosed by 'TickerSymbol="' and '"',
    DUMMY38 filler char(200) Terminated by WHITESPACE enclosed by 'MetPay="' and '"',
    DUMMY39 filler char(200) Terminated by WHITESPACE enclosed by 'MetRec="' and '"',
    DUMMY40 filler char(200) Terminated by WHITESPACE enclosed by 'Payrec="' and '"',
    DUMMY41 filler char(200) Terminated by WHITESPACE enclosed by 'RiskSection="' and '"',
    DUMMY54 filler char(200) Terminated by WHITESPACE enclosed by 'HedgedItem="' and '"',
    DUMMY43 filler char(200) Terminated by WHITESPACE enclosed by 'ResetFrequency="' and '"',
    DUMMY44 filler char(200) Terminated by WHITESPACE enclosed by 'ResetFrequencyNumber="' and '"',
    DUMMY45 filler char(200) Terminated by WHITESPACE enclosed by 'PaymentFrequency="' and '"',
    DUMMY46 filler char(200) Terminated by WHITESPACE enclosed by 'PaymentFrequencyNumber="' and '"',
    DUMMY47 filler char(200) Terminated by WHITESPACE enclosed by 'CapFloorCoupon="' and '"',
    DUMMY48 filler char(200) Terminated by WHITESPACE enclosed by 'RefIndexRate="' and '">',
    DUMMY50 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY51 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY52 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY53 filler char(1000) enclosed by "<Classification=" and "/>"
    INTO TABLE DERIVATIVE_POSITION
    WHEN PORTFOLIOCODE != ' '
    FIELDS TERMINATED BY '</NewDataSet>' optionally enclosed by '"'
    TRAILING NULLCOLS
    DUMMY1 filler char(65000) terminated by '<DerivativePosition ',
    DERIVATIVESECURITYID TERMINATED BY WHITESPACE enclosed by 'DerivativeSecurityID="' and '"',
    PORTFOLIOCODE TERMINATED BY WHITESPACE enclosed by 'PortfolioCode="' and '"',
    LONGSHORTINDICATOR TERMINATED BY WHITESPACE ENCLOSED BY 'LongShortIndicator="' and '"',
    FAS157Level filler char(100) TERMINATED BY WHITESPACE enclosed by 'FAS157Level="' and '"',
    FAS157MVAdjustable filler char(100) TERMINATED BY WHITESPACE enclosed by 'FAS157MVAdjustable="' and '"',
    OriginalMV filler char(100)TERMINATED BY WHITESPACE enclosed by 'OriginalMV="' and '"',
    FAS157MVDelta filler char(100) TERMINATED BY WHITESPACE enclosed by 'FAS157MVDelta="' and '"',
    FAS157AdjustedMV filler char(100)TERMINATED BY WHITESPACE enclosed by 'FAS157AdjustedMV="' and '"',
    CURRENTNOTIONALLOCAL TERMINATED BY WHITESPACE enclosed by 'CurrentNotionalLocal="' and '"',
    CURRENTNOTIONALUSD TERMINATED BY WHITESPACE enclosed by 'CurrentNotionalUSD="' and '"',
    OPENQUANTITY TERMINATED BY WHITESPACE enclosed by 'OpenQuantity="' and '"',
    ORIGINALNOTIONALLOCAL TERMINATED BY WHITESPACE enclosed by 'OriginalNotionalLocal="' and '"',
    ORIGINALNOTIONALUSD TERMINATED BY WHITESPACE enclosed by 'OriginalNotionalUSD="' and '"',
    ORIGINALQUANTITY TERMINATED BY WHITESPACE enclosed by 'OriginalQuantity="' and '"',
    ACCRUEDINTERESTLOCAL TERMINATED BY WHITESPACE enclosed by 'AccruedInterestLocal="' and '"',
    ACCRUEDINTERESTUSD TERMINATED BY WHITESPACE enclosed by 'AccruedInterestUSD="' and '"',
    ACCRUEDINTERESTBASE TERMINATED BY WHITESPACE enclosed by 'AccruedInterestBase="' and '"',
    CLEANMARKETVALUEENDOFDAYLOCAL TERMINATED BY WHITESPACE enclosed by 'CleanMarketValueEndOfDayLocal="' and '"',
    CLEANMARKETVALUEENDOFDAYUSD TERMINATED BY WHITESPACE enclosed by 'CleanMarketValueEndOfDayUSD="' and '"',
    CLEANMARKETVALUEENDOFDAYBASE TERMINATED BY WHITESPACE enclosed by 'CleanMarketValueEndOfDayBase="' and '"',
    DIRTYMARKETVALUEENDOFDAYLOCAL TERMINATED BY WHITESPACE enclosed by 'DirtyMarketValueEndOfDayLocal="' and '"',
    DIRTYMARKETVALUEENDOFDAYUSD TERMINATED BY WHITESPACE enclosed by 'DirtyMarketValueEndOfDayUSD="' and '"',
    PREMIUMLOCAL TERMINATED BY WHITESPACE enclosed by 'PremiumLocal="' and '"',
    PREMIUMUSD TERMINATED BY WHITESPACE enclosed by 'PremiumUSD="' and '"',
    PREMIUMBASE TERMINATED BY WHITESPACE enclosed by 'PremiumBase="' and '"',
    BIDDIES TERMINATED BY WHITESPACE enclosed by 'Biddies="' and '"',
    ADDONEXPOSUREUSD TERMINATED BY WHITESPACE enclosed by 'AddOnExposureUSD="' and '"',
    RegulatoryExposureUSD filler char(100) TERMINATED BY WHITESPACE enclosed by 'RegulatoryExposureUSD="' and '"',
    PARCR01 filler char(100) TERMINATED BY WHITESPACE enclosed by 'PARCR01="' and '"',
    FAS133DESIGNATIONGAAP TERMINATED BY WHITESPACE enclosed by 'FAS133DesignationGAAP="' and '"',
    FAS133DESIGNATIONSTAT TERMINATED BY WHITESPACE enclosed by 'FAS133DesignationSTAT="' and '"',
    TRADEDATE TERMINATED BY WHITESPACE enclosed by 'TradeDate="' and '"',
    EffectiveDate filler char(100) TERMINATED BY WHITESPACE enclosed by 'EffectiveDate="' and '"',
    ALLOCATION TERMINATED BY WHITESPACE enclosed by 'Allocation="' and '"' "round(:ALLOCATION,4)",
    DUMMY36 filler char(100) enclosed by '/' and '>'
    Log:
    Table DERIVATIVE_SECURITY:
    4079 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    28074 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Table DERIVATIVE_POSITION:
    0 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    32153 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 248196 bytes(26 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 32153
    Total logical records rejected: 0
    Total logical records discarded: 28074

    When there are multiple tables in a control file, SQL Loader assumes the data for the first file in the second table immediately follows the last field in the first table. You probably want SQL Loader to start looking for the first column of the second table at the start of the second table. You can do this by using the POSITION clause
    DUMMY51 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY52 filler char(1000) enclosed by "<Classification=" and "/>",
    DUMMY53 filler char(1000) enclosed by "<Classification=" and "/>"
    INTO TABLE DERIVATIVE_POSITION
    WHEN PORTFOLIOCODE != ' '
    FIELDS TERMINATED BY '</NewDataSet>' optionally enclosed by '"'
    TRAILING NULLCOLS
    DUMMY1 filler *position(1)* char(65000) terminated by '<DerivativePosition ',
    DERIVATIVESECURITYID TERMINATED BY WHITESPACE enclosed by 'DerivativeSecurityID="' and '"',
    PORTFOLIOCODE TERMINATED BY WHITESPACE enclosed by 'PortfolioCode="' and '"',
    .

Maybe you are looking for

  • I am having problems with installing my copy of PSE 8.

    I searched the adobe website for previous PSE version trials and there is none available for PSE 8 for Mac OSX. I have no cd/dvd drive so I have to get it online.

  • Time formatting in jsp

    Hi, I am creating one portal component in JSPDynPage in which I have to show auto generated date & time of xml news/article. Date & Time is generated but it is in MM/DD/YY - HH/MM/SS i.e. 10/23/2008 - 15:15:22 format .         But i want to display i

  • Nokia Energy Profiler and Battery indicator proble...

    Hi all, I have purchased nokia E71, but battery last very short (max. 2 days). I have installed Energy Profiler yo see how much power my phone uses in active anda idle mode and it showed in active: 0.17 and in idle 0.04, the batt. voltage is 3.77 and

  • New page defaults to picas even when changed to mm in unit preferences

    everytime i open a new document in indesign CC the new document dialog box shows the page measurments as picas even thought i would have changed it to mm in the unit preferences. It just reverts back again. how can i stop this from happening. i have

  • Object freezing when clicking and then releasing after moving mouse

    Hi there, When I want to select on object, I click on it. Then, the object freeze. I move my mouse wherever I want, wait 1-2 seconds, and the object comes where I am with my mouse. Could someone explain me what is the problem ? Is there an option che