Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How parse XML in PLSQL or java and generate dynamic SQL from it

How parse XML in PLSQL or java and generate dynamic SQL from it

From: Ksprasadreddy <ksprasadreddy_at_yahoo.com>
Date: 12 Sep 2003 09:31:12 -0700
Message-ID: <734701da.0309120831.20d6a1b7@posting.google.com>


There is not much help from Oracle Documents and very few samples available to do this, please help me.
This is what I am planning to achieve. I have input data in Xml document consists of data for multiple tables. I want write stored procedure take this Xml and generate dynamic SQL multiple inserts statements.
Sample XML is as follows.
<IMPORT method="add">
<ROW NO="1">
<TABLE>TABLE1</TABLE>
<COL><UIDBILLHISTORY>10</UIDBILLHISTORY><UIDACCOUNT>10</UIDACCOUNT></COL>
</ROW>
<ROW NO="2">
<TABLE>TABLE2</TABLE><COL><UIDCUSTOMER>12</UIDCUSTOMER><UIDACCOUNT>10</UIDACCOUNT></COL>
</ROW>
<ROW NO="2">
<TABLE>TABLE3</TABLE><COL><UIDACCTHIST>277</UIDCUSTOMER><UIDACCOUNT>10</UIDACCOUNT></COL>
</ROW>
</IMPORT>

I want get the out put something like this.

Insert into TABLE1 (UIDBILLHISTORY, UIDACCOUNT) values (10.100); 
Insert into TABLE2 (UIDCUSTOMER, UIDACCOUNT) values (10.100); 
Insert into TABLE3 (UIDACCTHIST, UIDACCOUNT) values (10.100); 


Thanks in advance
--Syamprasad Received on Fri Sep 12 2003 - 11:31:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US