Inserting xml data into an XMLTYPE table

  • From: "Schauss, Peter (ESS)" <peter.schauss@xxxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 29 Aug 2012 19:45:48 +0000

I have an xml file which has the format:

<XxxsSum>
<xxxSum>
        <A>...</A><B>...</B>...
</xxxSum>
<xxxSum>
        <A>...</A><B>...</B>...
</xxxSum>
...
</xxxsSum>

I have defined an XML_FILES directory and created a table (create table mytable 
of xmltype; ).

If I use a statement like 
        Insert into <mytable> values 
(xmltype(bfilename('XML_FILES','myfile.xml', nls_charset_id('AL32UTF8')));

it goes in as a single row.  How can I load this into a table so that each of 
the <xxxSum>...</xxxSum> blocks is in a separate row?

Thanks,
Peter Schauss
--
//www.freelists.org/webpage/oracle-l


Other related posts: