EJB2.0 CMP Bean table Name in XML file

hai all,
I have a doubt in ejb-jar.xml . I have noticed that we mention the field names <cmr-field> ... But where do we mention name of the table in the XML. do we have to make the bean name as that of table name .
Can Any one help me ?
Thnks
Sundar

Hi pls see this DD for CMP. in this "abstract-schema-name" is the Data Base table name...
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>CustomerBean</ejb-name>
<local-home>LocalCustomerHome</local-home>
<local>LocalCustomer</local>
<ejb-class>CustomerBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<abstract-schema-name>Customer</abstract-schema-name>
<cmp-field>
<field-name>lastName</field-name>
</cmp-field>
<primkey-field>customerID</primkey-field>
... other cmp fields
<ejb-local-ref>
<ejb-ref-name>ejb/AddressRef</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>LocalAddressHome</local-home>
<local>LocalAddress</local>
<ejb-link>AddressBean</
</ejb-local-ref>

Similar Messages

  • How to get the column name and table name from xml file

    I have one XML file, I generated xsd file from that xml file but the problem is i dont know table name and column name. So my question is how can I retrieve the data from that xml file?

    Here's an example using binary XML storage (instead of Object-Relational storage as described in the article).
    begin
      dbms_xmlschema.registerSchema(
        schemaURL       => 'my_schema.xsd'
      , schemaDoc       => xmltype(bfilename('TEST_DIR','my_schema.xsd'), nls_charset_id('AL32UTF8'))
      , local           => true
      , genTypes        => false
      , genTables       => true
      , enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS
      , options         => dbms_xmlschema.REGISTER_BINARYXML
    end;
    genTables => true : means that a default schema-based XMLType table will be created during registration.
    enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS : indicates that a repository resource conforming to the schema will be automatically stored in the default table.
    If the schema is not annotated, the name of the default table is system-generated but derived from the root element name :
    SQL> select table_name
      2  from user_xml_tables
      3  where xmlschema = 'my_schema.xsd'
      4  and element_name = 'employee';
    TABLE_NAME
    employee1121_TAB
    (warning : the name is case-sensitive)
    To annotate the schema and control the naming, modify the content to :
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
      <xs:element name="employee" xdb:defaultTable="EMPLOYEE_XML">
        <xs:complexType>
    Next step : create a resource, or just directly insert an XML document into the table.
    Example of creating a resource :
    declare
      res  boolean;
      doc  xmltype := xmltype(
    '<employee>
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>'
    begin
      res := dbms_xdb.CreateResource(
               abspath   => '/public/test.xml'
             , data      => doc
             , schemaurl => 'my_schema.xsd'
             , elem      => 'employee'
    end;
    The resource has to be schema-based so that the default storage mechanism is triggered.
    It could also be achieved if the document possesses an xsi:noNamespaceSchemaLocation attribute :
    SQL> declare
      2 
      3    res  boolean;
      4    doc  xmltype := xmltype(
      5  '<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6             xsi:noNamespaceSchemaLocation="my_schema.xsd">
      7    <details>
      8      <emp_id>1</emp_id>
      9      <emp_name>SMITH</emp_name>
    10      <emp_age>40</emp_age>
    11      <emp_dept>10</emp_dept>
    12    </details>
    13   </employee>'
    14   );
    15 
    16  begin
    17    res := dbms_xdb.CreateResource(
    18             abspath   => '/public/test.xml'
    19           , data      => doc
    20           );
    21  end;
    22  /
    PL/SQL procedure successfully completed
    SQL> set long 5000
    SQL> select * from "employee1121_TAB";
    SYS_NC_ROWINFO$
    <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceS
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>
    Then use XMLTABLE to shred the XML into relational format :
    SQL> select x.*
      2  from "employee1121_TAB" t
      3     , xmltable('/employee/details'
      4         passing t.object_value
      5         columns emp_id   integer      path 'emp_id'
      6               , emp_name varchar2(30) path 'emp_name'
      7       ) x
      8  ;
                                     EMP_ID EMP_NAME
                                          1 SMITH

  • Inserting data from  a table  to an XML file

    I want to insert the values from this xml file emp.xml into a table Employees :
    <EMPLOYEES>
    <EMP>
    <EMPNO>7369</EMPNO>
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <HIREDATE>17-DEC-80</HIREDATE>
    <SAL>800</SAL>
    </EMP>
    <EMP>
    <EMPNO>7499</EMPNO>
    <ENAME>ALLEN</ENAME>
    <JOB>SALESMAN</JOB>
    <HIREDATE>20-FEB-81</HIREDATE>
    <SAL>1600</SAL>
    <COMM>300</COMM>
    </EMP>
    <EMP>
    </EMPLOYEES>
    and here is my Employee table in Oracle 9i database
    SQL> DESC EMPLOYEE;
    Name Null? Type
    EMPNO NUMBER
    EMPNAME VARCHAR2(10)
    JOB VARCHAR2(10)
    HIREDATE DATE
    SAL NUMBER
    After getting help from the members i was able to do the insert of data from the xml file to the table..how to do the insert of data from the table to the xml file.
    Regards,
    Renu

    Hello michaels , thank you for the solution, still i am having some problems
    Here is what i have done :
    1.
    SQL> CREATE DIRECTORY my_table_dir AS 'E:\table_files'
    2 ;
    Directory created.
    2.
    SQL> select * from myemp;
    ENAME
    SMITH
    ALLEN
    3.
    This is the content of the existing xml file saved in the directory E:\table_files as emp.xml
    <EMPLOYEES>
    <EMP>JIM</EMP>
    <EMP>RICK</EMP>
    </EMPLOYEES>
    4.
    Now i executed this code :
    declare
    emp_xml xmltype;
    begin
    select sys_xmlagg (column_value, sys.xmlformat ('EMPLOYEES')) emp_xml
    into emp_xml
    from table (xmlsequence (cursor (select *
    from myemp
    where ename in ('SMITH', 'ALLEN')),
    sys.xmlformat ('EMP')
    dbms_xslprocessor.clob2file (emp_xml.getclobval (), 'E:\table_files', 'emp.xml');
    end;
    And the Error i got is :
    declare
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 18
    ORA-06512: at "SYS.UTL_FILE", line 424
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 46
    ORA-06512: at line 12

  • Internal table data to XML file.

    Hi All,
    May I know how can we convert the internal table data to xml file?
    Regards
    Ramesh.

    Re: Convert XML to internal Table
       Go through the link..u should be able to solve the problem..

  • Change name of .xml file.

    Can anyone help me?
    Being new to podcasing and not realising that I only need one xml file even for multiple episodes I gave my file a specific name relating to the subject of my first episode. Realising my mistake I would like to re-name the .xml file, is that possible now that iTunes have already accepted my podcast?

    Sure, just copy your old file over to the new URL.
    Then edit the "old" copy and cram this into it:
    http://www.apple.com/itunes/store/podcaststechspecs.html#_Toc526931687
    So when Apple visits the old one, they find the new one.
    You can also do the fancy 301 redirect (not 302) if you know what that means, or want to figure it out. It's an HTTP response code in the HTTP protocol to note that a document has "permanently moved"

  • Exporting data from database tables to a XML file

    Hi,
    We want to export data from Oracle database tables to an XML
    file. What tool can we use for this purpose, and how do we go
    about it ?
    Can we extract data only from an Oracle8 database, or can we
    extract data from Oracle7.3 databases too ?
    Any help in this regard would be appreciated.
    Thanks
    Dipanjan
    null

    Dipanjan (guest) wrote:
    : Hi,
    : We want to export data from Oracle database tables to an XML
    : file. What tool can we use for this purpose, and how do we go
    : about it ?
    : Can we extract data only from an Oracle8 database, or can we
    : extract data from Oracle7.3 databases too ?
    : Any help in this regard would be appreciated.
    : Thanks
    : Dipanjan
    Start by downloading the XML SQL Utility and make sure you have
    the approriate JDBC 1.1 drivers installed for your database.
    There are samples which will get you going included in the
    archive.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Table name in XML output

    Hello Experts,
    My XML output from XI looks like:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_UPDATE_STATUS xmlns:ns0="http://test.test.ca">
    - <STATEMENTNAME>
    - <dbTableName action="UPDATE">
      <TABLE>stfx.job_copy</TABLE>
    - <access>
      <status1>DONE</status1>
      <status2>DONE</status2>
      </access>
    - <key>
      <jobId>00595593</jobId>
      <status1>NEW</status1>
      <messagenm>d3e98e294bfcd2d5d3e98e29</messagenm>
      </key>
      </dbTableName>
      </STATEMENTNAME>
      </ns0:MT_UPDATE_STATUS>
    However, I need to change the table name being output from stfx.job_copy to stfx.job_history .  How do I do this??? Where is it configured?
    Thanks
    null

    Hi Ahmad,
    That worked - although I see what you mean.  It shouldn't be left like this.
    Back to the original problem.  I currently have XML being generated as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_UPDATE_STATUS xmlns:ns0="http://test.test.ca">
    - <STATEMENTNAME>
    - <dbTableName action="UPDATE">
    <TABLE>stfx.job_copy</TABLE>
    - <access>
    <status1>DONE</status1>
    <status2>DONE</status2>
    </access>
    - <key>
    <jobId>00595593</jobId>
    <status1>NEW</status1>
    <messagenm>d3e98e294bfcd2d5d3e98e29</messagenm>
    </key>
    </dbTableName>
    </STATEMENTNAME>
    </ns0:MT_UPDATE_STATUS>
    I need to change stfx.job_copy to stfx.job_history.  Now that I am able to edit the IR, I still don't see where stfx.job_copy is hard-coded.  I know it is in message mapping, but when I click on TABLE, I do not see anywhere to change stfx.job_copy.  Any ideas?
    Thanks

  • How to export table contents in xml file format through SQL queries

    hi,
    i need to export the table data in to xml file format. i got it through the GUI what they given.
    i'm using Oracle 10g XE.
    but i need to send the table name from Java programs. so, how to call the export commands from programming languages through. is there any sql commands to export the table contents in xml format.
    and one more problem is i created each transaction in two tables. for example if we have a transaction 'sales' , that will be saved in db as
    sales1 table and sales2 table. here i maintained and ID field in sales1 as PK. and id as FK in sales2.
    i get the combined data with this query,
    select * from sales1 s1, sales2 s2 where s1.id=s2.id order by s1.id;
    it given all the records, but i'm getting two ID fields (one from each table). how to avoid this. here i dont know how many fields will be there in each table. that will be known at runtime only.
    the static information is sales1 have one ID field with PK and sales2 will have one ID filed with FK.
    i need ur valuable suggestions.
    regards
    pavan.

    You can use DBMS_XMLGEN.getXML('your Query') for generating data in tables to XML format and you can use DBMS_XMLGEN.SETROWSETTAG to change the parent element name other wise it will give rowset as well as DBMS_XMLGEN.SETROWTAG for row name.
    Check this otherwise XMLELEMENT and XMLFOREST function are also there to convert data in XML format.

  • Need to insert values into a table from a XML file

    Hi,
    I'm an Oracle 9i/10g DBA with quite a few years experience, but I'm new to XML and dealing with it in database terms. I've been given a project that entails pulling XML values out of a file (or 100's of them) and storing them in the database so that they are searchable by end-users. The project is classified as secret so I'm unable to upload the specific XML or any info relating to the structire of the XML or the table I will use to insert the values into - sorry!! So, I've created an XML file with a similar structure to help people understand my predicament.
    The end-users only need to search on a subset of the total amount of columns from the table I'll insert data into, although the XML file has a lot more, so I dont need to store the other values - but I will need to store the name of the XML file (or a pointer to it so I know what XML file a particular set of values belong to) in another column of the table along with its associated values.
    I've been using the XMLTABLE function with some degree of success, although I had better succes using the XMLSEQUENCE function. However, I found out this is deprecated in 10g and replaced with XMLTABLE, so I guess it's better if I use this in case we ever need to upgrade to 11g.
    The main problem I've been having is that some elements in the XML files have multiple values for the one record when all the other records are the same. In terms of storing this in the database, I guess it would mean inserting multiple rows in the table for each element where the value differs. Here is a dumbed down XML file similar to what I've got along with the other SQL I've used:
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<House>+
    +<Warehouse>+
    +<WarehouseId>1</WarehouseId>+
    +<WarehouseName>+
    +<Town>Southlake</Town>+
    +<State>Texas</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>25000</Area>+
    +<Docks>2</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Street</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>2</WarehouseId>+
    +<WarehouseName>+
    +<Town>Poole</Town>+
    +<State>Dorset</State>+
    +</WarehouseName>+
    +<WarehouseName>+
    +<Town>Solihull</Town>+
    +<County>West Midlands</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>40000</Area>+
    +<Docks>5</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>3</WarehouseId>+
    +<WarehouseName>+
    +<Town>Fleet</Town>+
    +<County>Hampshire</County>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>10000</Area>+
    +<Docks>1</Docks>+
    +<DockType>Side load</DockType>+
    +<WaterAccess>false</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>20</VClearance>+
    +</Warehouse>+
    +</House>+
    CREATE TABLE xmltest OF XMLTYPE;
    INSERT INTO xmltest
    VALUES(xmltype(bfilename('XML_DIR', 'test.xml'), nls_charset_id('AL32UTF8')));
    Consequently, I need to...
    1) Retrieve the results from the XML file for all 3 warehouses where multiple values for the same sub-element are shown as 2 rowsthe result set. (I am guessing there will be 4 rows returned as warehouse sub-2 has 2 different elements for <WarehouseName>.
    2) Build a case statement into the query so that regardless of the sub-element name (i.e State or County), it is returned into the 1 column, for instance County.
    So, if I run a query similar to the following...
    select y.WarehouseId, y.Town, y.County, y.Area
    from xmltest x, xmltable('/House/Warehouse' .......
    I would like to get results back like this...
    ID Town County Area
    1 Southlake Texas 25000
    2 Poole Dorset 40000
    2 Solihull West Midlands 40000
    3 Fleet hampshire 10000
    Sorry for the non-formatting but I hope this all makessense to someone out there with what I'm trying to do.
    I appreciate any help whatsoever because, as i said before, I'm totally new to XML and trying to read the vast amount of information there is out there on XML is all a bit daunting.
    Many thanks in advance,
    Shaun.

    Hi again,
    Thanks for keeping the post open for me. I've had a look at the post illustrating the XFileHandler package, and tried to alter it to make it fit with my XML files. To help explain things, my XML file looks like this:
    <?xml version="1.0"?>
    <!DOCTYPE  CMF_Doc SYSTEM "CMF_Doc.dtd">
    <House>
        <Warehouse>
        <WarehouseId>1</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>House
        <WarehouseId>2</WarehouseId>
        <WarehouseName>
           <Town>Poole</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>3</WarehouseId>
        <WarehouseName>
           <Town>Fleet</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>4</WarehouseId>
        <WarehouseName>
           <Town>Dallas</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>5</WarehouseId>
        <WarehouseName>
           <Town>Dorchester</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>6</WarehouseId>
        <WarehouseName>
           <Town>Farnborough</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>7</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>8</WarehouseId>
        <WarehouseName>
           <Town>Bournemouth</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Shirley</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>30000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>9</WarehouseId>
        <WarehouseName>
           <Town>Clapham</Town>
           <County>London</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>And the XFilehandler package looks like this (I'm just trying to do a simple select only on WarehouseId & WaterAccess for the time being to keep things simple):
    create or replace package XFileHandler as
      TYPE TRECORD IS RECORD (
        WID     NUMBER(2)
      , WACCESS VARCHAR2(5)
      type TRecordTable is table of TRecord;
      function getRows (p_directory in varchar2, p_filename in varchar2) return TRecordTable pipelined;
    end;
    create or replace package body XFileHandler is
      function getRows (p_directory in varchar2, p_filename in varchar2)
       return TRecordTable pipelined
      is
        nb_rec          number := 1;
        tmp_xml        clob;
        tmp_file         clob;
        rec               TRecord;
      begin
        DBMS_LOB.CREATETEMPORARY(TMP_FILE, TRUE);
        tmp_file := dbms_xslprocessor.read2clob(p_directory, p_filename);
        LOOP
          tmp_xml := regexp_substr(tmp_file, '<\?xml[^?]+\?>\s*<([^>]+)>.*?</\1>', 1, nb_rec, 'n');
          exit when length(tmp_xml) = 0;
          --dbms_output.put_line(tmp_rec);
          nb_rec := nb_rec + 1;
        select y.WID, y.WACCESS
        into rec.WID, rec.WACCESS
        from xmltable('/House' passing xmltype(tmp_xml)
                      columns WID NUMBER(2) PATH 'Warehouse/WarehouseId',
                                  WACCESS VARCHAR2(5) PATH 'WaterAccess') y;
          pipe row ( rec );
        end loop;
        dbms_lob.freetemporary(tmp_file);
        return;
      end;
    end;Now, when I run the query:
    select * from table(XFileHandler.getRows('XML_DIR', 'XFileHandler_test.xml'));I get the error: ORA-00600: internal error code, arguments: [17285], [0x5CFE8DC8], [4], [0x45ABE1C8], [], [], [], []
    I had a look in the dump file for anything obvious, but nothing really stands out. Is there anything obvious in my code that I'm missing or something else which you may think could be causing this error, e.g in the regular expression regexp_substr?
    Many thanks,
    Shaun.

  • Creating a PL/SQL table based on XML file.

    I have created two procedures to try and achieve the problem at hand.
    It retrieves and displays the record from a DBMS_OUTPUT.PUT_LINE prospective as indicated in (1&2), but I am having difficulty loading these values into a PL/SQL table from the package labeled as (3).
    All code compiles. (1&2) work together, (3) works by itself but will not populate the table, and I get no errors.
    1.The first being the one that retrieves the XML file and parses it.
    CREATE OR REPLACE procedure xml_main is
    P XMLPARSER.Parser;
    DOC CLOB;
    v_xmldoc xmldom.DOMDocument;
    v_out CLOB;
    BEGIN
    P := xmlparser.newParser;
    xmlparser.setValidationMode(p, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    --v_out  := DOC;
    SYS.XMLPARSER.PARSECLOB ( P, DOC );
    v_xmldoc := SYS.XMLPARSER.getDocument(P);
    --DBMS_LOB.createtemporary(v_out,FALSE,DBMS_LOB.SESSION);
    --v_out := SYS.XMLPARSER.PARSECLOB ( P, DOC );
    --SYS.XMLDOM.writetoCLOB(v_xmldoc, v_out);
    --INSERT INTO TEST (TEST_COLUMN)
    --VALUES(V_OUT);
    --printElements(v_xmldoc);
    printElementAttributes(v_xmldoc);
    exception
    when xmldom.INDEX_SIZE_ERR then
    raise_application_error(-20120, 'Index Size error');
    when xmldom.DOMSTRING_SIZE_ERR then
    raise_application_error(-20120, 'String Size error');
    when xmldom.HIERARCHY_REQUEST_ERR then
    raise_application_error(-20120, 'Hierarchy request error');
    when xmldom.WRONG_DOCUMENT_ERR then
    raise_application_error(-20120, 'Wrong doc error');
    when xmldom.INVALID_CHARACTER_ERR then
    raise_application_error(-20120, 'Invalid Char error');
    when xmldom.NO_DATA_ALLOWED_ERR then
    raise_application_error(-20120, 'Nod data allowed error');
    when xmldom.NO_MODIFICATION_ALLOWED_ERR then
    raise_application_error(-20120, 'No mod allowed error');
    when xmldom.NOT_FOUND_ERR then
    raise_application_error(-20120, 'Not found error');
    when xmldom.NOT_SUPPORTED_ERR then
    raise_application_error(-20120, 'Not supported error');
    when xmldom.INUSE_ATTRIBUTE_ERR then
    raise_application_error(-20120, 'In use attr error');
    END;
    2. The second which displays the values from the .xml file I initialized above.
    CREATE OR REPLACE procedure printElementAttributes(doc xmldom.DOMDocument) is
    nl XMLDOM.DOMNODELIST;
    len1           NUMBER;
    len2 NUMBER;
    n      XMLDOM.DOMNODE;
    e      XMLDOM.DOMELEMENT;
    nnm      XMLDOM.DOMNAMEDNODEMAP;
    attrname VARCHAR2(100);
    attrval VARCHAR2(100);
    text_value VARCHAR2(100):=NULL;
    n_child XMLDOM.DOMNODE;
    BEGIN
    -- get all elements
    nl := XMLDOM.getElementsByTagName(doc, '*');
    len1 := XMLDOM.getLength(nl);
    -- loop through elements
    FOR j in 0..len1-1 LOOP
    n := XMLDOM.item(nl, j);
    e := XMLDOM.makeElement(n);
    DBMS_OUTPUT.PUT_LINE(xmldom.getTagName(e) || ':');
    -- get all attributes of element
    nnm := xmldom.getAttributes(n);
         n_child:=xmldom.getFirstChild(n);
    text_value:=xmldom.getNodeValue(n_child);
    dbms_output.put_line('val='||text_value);
    IF (xmldom.isNull(nnm) = FALSE) THEN
    len2 := xmldom.getLength(nnm);
              dbms_output.put_line('length='||len2);
    -- loop through attributes
    FOR i IN 0..len2-1 LOOP
    n := xmldom.item(nnm, i);
    attrname := xmldom.getNodeName(n);
    attrval := xmldom.getNodeValue(n);
    dbms_output.put(' ' || attrname || ' = ' || attrval);
    END LOOP;
    dbms_output.put_line('');
    END IF;
    END LOOP;
    END printElementAttributes;
    3. The package trying to insert into a PL/SQL table.
    CREATE OR REPLACE PACKAGE BODY XMLSTUD2 AS
    PROCEDURE STUDLOAD
    IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    DOC CLOB;
    v_out CLOB;
    n2 XMLDOM.DOMNODELIST;
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    --l_sturec students%rowtype;
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address');
    dbms_output.put_line( 'New Stud processed on '||to_char(sysdate, 'YYYY-MON-DD'));
    -- Loop through the list and create a new record in a tble collection
    -- for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
         --s_tab(s_tab.last).STUDENT_ID :=xslprocessor.valueOf(v_n,'StudentNumber');
         --s_tab(s_tab.last).SSN :=xslprocessor.valueOf(v_n,'ExternalIdNumber');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'StateIdNumber');
         s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'LastName');
         --dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
         s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'FirstName');
         --s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'MiddleName');
         --s_tab(s_tab.last).STUDENT_GENDER :=xslprocessor.valueOf(v_n,'Gender');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Month');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Day');
         --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Year');
         --s_tab(s_tab.last).STUDENT_RACE :=xslprocessor.valueOf(v_n,'Race');
         --s_tab(s_tab.last).STUDENT_ETHNIC :=xslprocessor.valueOf(v_n,'Ethnicity');
         --s_tab(s_tab.last).STUDENT_PRI_LANG :=xslprocessor.valueOf(v_n,'PrimaryLanguage');
         --s_tab(s_tab.last).STUDENT_SEC_LANG :=xslprocessor.valueOf(v_n,'HouseholdLanguage');
         --s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'Street');
         --s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'ApartmentNumber');
         --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'City'); 
         --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'County');
         --s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'State');
         --s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'ZipCode');
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
    dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
    INSERT INTO STUDENTS (
    SHISID, SSN, DOE_SCHOOL_NUMBER,
    PATIENT_TYPE, TEACHER, HOMEROOM,
    STUDENT_LAST_NAME, STUDENT_FIRST_NAME, STUDENT_MI,
    STUDENT_DOB, STUDENT_BIRTH_CERT, STUDENT_COMM,
    STUDENT_MUSA, STUDENT_FAMSIZE, STUDENT_FAMINCOME,
    STUDENT_UNINSURED, STUDENT_LUNCH, STUDENT_ZIP,
    STUDENT_STATE, STUDENT_COUNTY, STUDENT_STREET,
    STUDENT_APART_NO, STUDENT_PHONE, STUDENT_H2O_TYPE,
    STUDENT_WASTE_TRT, STUDENT_HOME_SET, STUDENT_NONHOME_SET,
    STUDENT_GENDER, STUDENT_RACE, STUDENT_ETHNIC,
    STUDENT_PRI_LANG, STUDENT_SEC_LANG, STUDENT_ATRISK,
    EMER_COND_MEMO, ASSIST_DEVICE_TYPE, SCHOOL_ENTER_AGE,
    STUDENT_CURR_GRADE, S504_ELIG_DATE, S504_DEV_DATE,
    S504_REV_DATE, STUDENT_504, STUDENT_IEP,
    IEP_EXP_DATE, GRAD_CLASS, TYPE_DIPLOMA,
    GRADE_RETAIN, LIT_PASS_TEST_MATH, LIT_PASS_DATE_MATH,
    LIT_PASS_TEST_WRITE, LIT_PASS_DATE_WRITE, LIT_PASS_TEST_READ,
    LIT_PASS_DATE_READ, SPEC_ED_ELIG, SPEC_ED_CODE,
    TRANSPORT_CODE, TRANSPORT_NO, PRIME_HANDICAP,
    PRIME_HANDICAP_PERCENT, PRIME_HANDI_MANAGER, FIRST_ADD_HANDI,
    FIRST_ADD_HANDICAP_PERCENT, FIRST_ADD_HANDI_504, FIRST_ADD_HANDI_504_DATE,
    SECOND_ADD_HANDI, SECOND_ADD_HANDICAP_PERCENT, MED_EXTERNAL_NAME,
    INS_TYPE, INS_PRI, INS_NAME,
    INS_MEDICAID_NO, ELIGDATE, INS_PRIV_INSURANCE,
    INS_APPR_BILL, INS_APPR_DATE, INS_PARENT_APPR,
    INS_POL_NAME, INS_POL_NO, INS_CARRIER_NO,
    INS_CARRIER_NAME, INS_CARRIER_RELATE, INS_AFFECT_DATE,
    INS_COPAY_OV, INS_COPAY_RX, INS_COPAY_AMBUL,
    INS_COPAY_EMER, INS_COPAY_OUTPAT, STUDENT_INACTIVE,
    PHYS_ID, ENCOUNTERNUM, USERID,
    MODDATE, STUDENT_ID, S504_DISABILITY,
    CHAPTER1, WELLNESS_ENROLL, SCHOOL_OF_RESIDENCE,
    INITIAL_IEP_DATE, CALENDAR_TRACK, USA_BORN,
    ALT_ID, FUTURE_SCHOOL, IEP_LAST_MEETING,
    IEP_LAST_SETTING, IEP_LAST_REFER_EVAL, THIRD_ADD_HANDI,
    LEP, GIFTED, IEP_EXIT_REASON,
    CASE_MANAGER_ID, INTAKE_NOTES, CALLER_PHONE,
    CALL_DATE, CALLER_RELATIONSHIP, CALLER_NAME,
    BUSINESS_PHONE, FAX, EMAIL,
    HIGHEST_EDUCATION, INTAKE_DATE, SERVICE_COORDINATOR,
    DISCHARGE_DATE, DISCHARGE_REASON, DISCHARGE_NOTES,
    INTAKE_BY, INTAKE_STATUS, IEP_LAST_SERVED_DATE,
    IEP_APC_DATE, IEP_EXIT_DATE, ADDRESS2,
    LEGAL_STATUS, RELIGION, EMPLOYMENT_STATUS,
    TARG_POP_GROUP1, TARG_POP_GROUP2, MARITAL_STATUS,
    THIRD_ADD_HANDI_PERCENT, LAST_INTERFACE_DATE, SERVICE_PLAN_TYPE,
    CURRENT_JURISDICTION, FIPS, BIRTH_PLACE_JURISDICTION,
    BIRTH_PLACE_HOSPITAL, BIRTH_PLACE_STATE, BIRTH_PLACE_COUNTRY,
    OTHER_CLIENT_NAME, SIBLINGS_WITH_SERVICES, PERM_SHARE_INFORMATION,
    PERM_VERIFY_INSURANCE, REFERRING_AGENCY, REFERRING_INDIVIDUAL,
    AUTOMATIC_ELIGIBILITY, INTAKE_IEP_ID, FUTURE_SCHOOL2,
    FUTURE_SCHOOL3, TRANSLATOR_NEEDED, TOTAL_CHILDREN_IN_HOME,
    REFERRED_BY, FAMILY_ID, SCREENING_CONSENT_FLAG,
    PICTURE_FILE, DUAL_ENROLLED, DOE_SCHOOL_NUMBER2)
    VALUES (123456789012, null,null ,
    null,null,null ,s_tab(stud).STUDENT_LAST_NAME
    , s_tab(stud).STUDENT_LAST_NAME,null ,
    null ,null ,null ,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null, null,null );
    END LOOP;
    COMMIT;
    -- Free any resources associated with the document now it
    -- is no longer needed.
    xmldom.freeDocument(v_doc);
    END STUDLOAD;
    END XMLSTUD2;
    /

    Hi
    I have created a PLSQL package based Oracle Portal
    form. This is created a s a databse provider. I have
    following questions to check :
    1. How to capture return values from the package and
    display different messages on success or failure ?
    - http://download.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_portletbuilder.htm#BABBAFGI
    Step 16
    2. How to return to blank form by intializing already
    entered values after successfuly process of the form
    data.
    - http://download.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_portletbuilder.htm#BABGBCHH
    thanks
    Manjith

  • Creation of External table by using XML files.

    I am in the process of loading of XML file data into the database table. I want to use the External Table feature for this loading. Though we have the external table feature with Plain/text file, is there any process of XML file data loading into the Database table by using External table?
    I am using Oracle 9i.
    Appreciate your responses.
    Regards
    Edited by: user652422 on Dec 16, 2008 11:00 PM

    Hi,
    The XML file which U posted is working fine and that proved that external table can be created by using xml files.
    Now My problem is that I have xml files which is not as the book.xml, my xml file is having some diff format. below is the extracts of the file ...
    <?xml version="1.0" encoding="UTF-8" ?>
    - <PM-History deviceIP="172.20.7.50">
    <Error Reason="" />
    - <Interface IntfName="otu2-1-10B-3">
    - <TS Type="15-MIN">
    <Error Reason="" />
    - <PM-counters TimeStamp="02/13/2008:12:15">
    <Item Name="BBE-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="BBE-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="ES-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="ES-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="SES-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="SES-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="CSES-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="CSES-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="UAS-S" Direction="Received" Validity="ADJ" Value="135" />
    <Item Name="UAS-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="SEF-S" Direction="Received" Validity="ADJ" Value="135" />
    </PM-counters>
    <PM-counters TimeStamp="03/26/2008:12:30">
    <Item Name="BBE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="BBE-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="ES" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="ES-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="SES" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="SES-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="CSES" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="CSES-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="UAS" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="UAS-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="PSC" Direction="Received" Validity="OFF" Value="0" />
    </PM-counters>
    </TS>
    </Interface>
    </PM-History>
    My problem is the Item Name and Direction the value of both(ex PSCReceived or UASReceived) will be treated as the coulmn name of the table and '0' would be the value of that column. I am confused how to create the external table creation program for that.
    I would really appreciate your responses.
    Regards

  • Should I create table before insert xml files

    Hi,,,
    I am developing a application that insert various xml files
    into oracle8i dbms..
    So, I am studying Oracle XML SQL Utility and I understood that
    I should create appropriate tables suit for the XML files..
    (tag <--> table column name...) before insert them to the dbms.
    But In my project, the xml file is not fixed.
    And new XML files (new tag name, new DTD required) can be
    generated by the end user.
    Is there any solution??? create table suit for xml
    automatically..
    And...
    How can I create table to insert the following xml file..
    <univ>
    <college name="engineering">
    <department name="electronic">
    <student id="11">
    <math> 100 </math>
    <english> 90 </english>
    </student>
    </department>
    </college>
    <college name="law">
    <department name="law">
    <student id="55">
    <math> 90 </math>
    <english> 100 </english>
    </student>
    </department>
    </college>
    </univ>
    null

    Hi,
    One more thing is that, you can use XSLT to transform any
    document that you get into a canonical representation that u can
    then use to put into the database.
    For example, if the user gave,
    <univ>
    <college name="eng">
    <...>
    </college>
    </univ>
    you can then use XSLT to transform it into all-element form,
    such as,
    <univ>
    <college>
    <name>engineering</name>
    </college>
    </univ>
    and use OracleXMLSave to put it into the database. Also if you
    have structured XML elements you can map them nicely into object
    types in Oracle 8.
    Regarding creating the table, for the exampe that you showed,
    you can create an object type column for storing it,example,
    CREATE TYPE college_type AS OBJECT
    name VARCHAR2(50),
    dept department_type,
    CREATE TYPE department_type AS OBJECT
    name VARCHAR2(40),
    CREATE TABLE univ_tab ( college college_type);
    You could have also created object views over multiple
    relational tables and achieved the same.
    Thx
    The OracleXML team.
    Oracle XML Team wrote:
    : Instead of using attributes to store your data, use elements.
    : For example:
    : <univ>
    : <college>
    : <collname>engineering</collname>
    : <department>
    : <deptname>electronic</deptname>
    : <student>
    : <id>11</id>
    : <math>100</math>
    : <english>90</english>
    : </student>
    : </college>
    : </univ>
    : Oracle XML Team
    : http://technet.oracle.com
    : Oracle Technology Network
    : Chong, Ho-chul (guest) wrote:
    : : Hi,,,
    : : I am developing a application that insert various xml files
    : : into oracle8i dbms..
    : : So, I am studying Oracle XML SQL Utility and I understood
    : that
    : : I should create appropriate tables suit for the XML files..
    : : (tag <--> table column name...) before insert them to the
    dbms.
    : : But In my project, the xml file is not fixed.
    : : And new XML files (new tag name, new DTD required) can be
    : : generated by the end user.
    : : Is there any solution??? create table suit for xml
    : : automatically..
    : : And...
    : : How can I create table to insert the following xml file..
    : : <univ>
    : : <college name="engineering">
    : : <department name="electronic">
    : : <student id="11">
    : : <math> 100 </math>
    : : <english> 90 </english>
    : : </student>
    : : </department>
    : : </college>
    : : <college name="law">
    : : <department name="law">
    : : <student id="55">
    : : <math> 90 </math>
    : : <english> 100 </english>
    : : </student>
    : : </department>
    : : </college>
    : : </univ>
    Oracle Technology Network
    http://technet.oracle.com
    null

  • How to download internal table data into xml file?

    Hi,
    Experts,
    I have downloaded internal table data into XLS format using GUI_DOWNLOAD Function module, But i didn't Know how to download internal table data into XML format please post some ideas/inputs on this issue.
    Thank you,
    Shabeer ahmed.

    check this
    data : gd_repid type sy-repid.
    GD_REPID = SY-REPID.
    DATA : L_DOM TYPE REF TO IF_IXML_ELEMENT,
           M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
           G_IXML TYPE REF TO IF_IXML,
           W_STRING TYPE XSTRING,
           W_SIZE TYPE I,
           W_RESULT TYPE I,
           W_LINE TYPE STRING,
           IT_XML TYPE DCXMLLINES,
           S_XML LIKE LINE OF IT_XML,
           W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
          BEGIN OF XML_TAB OCCURS 0,
          D LIKE LINE OF XML,
          END OF XML_TAB.
    data : l_element           type ref to if_ixml_element,
           xml_ns_prefix_sf     type string,
           xml_ns_uri_sf        type string.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
       NAME = 'REPAIRDATA'
       DATAOBJECT = IT_FINAL_LAST1[]
    IMPORTING
       DATA_AS_DOM = L_DOM
    CHANGING
       DOCUMENT = M_DOCUMENT
    EXCEPTIONS
       ILLEGAL_NAME = 1
       OTHERS = 2.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    *Start of code for Header
    * namespace
    t_mnr = sy-datum+4(2).
    CALL FUNCTION 'IDWT_READ_MONTH_TEXT'
      EXPORTING
        LANGU         = 'E'
        MONTH         = t_mnr
    IMPORTING
       T247          = wa_t247
    concatenate sy-datum+6(2)
                wa_t247-ktx
                sy-datum(4) into t_var1.
    concatenate sy-uzeit(2)
                sy-uzeit+2(2)
                sy-uzeit+4(2) into t_var2.
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    l_element  = m_document->get_root_element( ).
    xml_ns_prefix_sf = 'TIMESTAMP'.
    concatenate t_var1 t_var2 into xml_ns_uri_sf separated by space.
    clear : t_var1,
            t_var2,
            t_mnr,
            wa_t247.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    xml_ns_prefix_sf  = 'FILECREATOR'.
    xml_ns_uri_sf    =   'SAP'.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    xml_ns_prefix_sf  = 'CLAIMGROUP'.
    xml_ns_uri_sf    = '1'.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    xml_ns_prefix_sf  = 'CLAIMTYPES'.
    xml_ns_uri_sf    = 'W'.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    *End of Code for Header
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
      DOCUMENT = M_DOCUMENT
    IMPORTING
      XML_AS_STRING = W_STRING
      SIZE = W_SIZE
    TABLES
      XML_AS_TABLE = IT_XML
    EXCEPTIONS
      NO_DOCUMENT = 1
      OTHERS = 2.
    LOOP AT IT_XML INTO XML_TAB-D.
    APPEND XML_TAB.
    ENDLOOP.
    *Start of Code for File name
    concatenate p_file
                '\R'
                '000_119481'
                sy-datum+6(2) sy-datum+4(2) sy-datum+2(2)
                sy-uzeit(2)   sy-uzeit+2(2) sy-uzeit(2) '.xml' into p_file.
    *End of Code for File name
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE = W_SIZE
      FILENAME = p_file
      FILETYPE = 'BIN'
    TABLES
      DATA_TAB = XML_TAB
    EXCEPTIONS
      OTHERS = 10.
    IF SY-SUBRC  = 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Missing slide name in xml file

    Before I upgrade from Captivate 5.5 to 7 I need to understand why - When I open the xml file to  review the quiz results, I cannot find the slide name.  When I give management the test results, I would like to have the slide name, with the rest of the information.  Is there a complete tutorial I can review to show me how to.

    Hi Lisa,
    What I understood from your question is: SAP is generating a file and you want to add few more things to that file in XI.
    If we both are on the same page then you can create a xsd or extend the current xsd with the additional fields and then can load the file and send across XI.
    If we are not on the same page then can you throw some more light on this?
    Regards,
    ---Satish

  • Change MessageType name in xml file

    Hi experts,
    I have developed a receiver interface that creates an xml file and put it on an external server.
    Now other side says that this tag:
    <ns0:MT_MexElectronicInvoice_EDICOM xmlns:ns0="urn:Myfirm-EDICOM:MexElectronicInvoice">
    is not correct, they want another description:
    <ns0:MT_MexElectronicInvoice_myFirm xmlns:ns0="urn:Myfirm-EDICOM:MexElectronicInvoice">
    My question is: is possible to change MessageType tag in xml file without changing the message type structure name in Integration Repository?
    thanks
    fabio

    use another mapping which has the target  MT as  <ns0:MT_MexElectronicInvoice_myFirm xmlns:ns0="urn:Myfirm-EDICOM:MexElectronicInvoice">
    Add this mapping after the original mapping in your interface/operation mapping.
    This will be the easiest way to handle this requirement as you will only need to do a one to one mapping.
    Another option will be to write a java mapping to do a simple replace function for the string <ns0:MT_MexElectronicInvoice_EDICOM xmlns:ns0="urn:Myfirm-EDICOM:MexElectronicInvoice"> to  <ns0:MT_MexElectronicInvoice_myFirm xmlns:ns0="urn:Myfirm-EDICOM:MexElectronicInvoice">

Maybe you are looking for