Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> How parse XML in PLSQL or java and generate dynamic SQL from it
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
![]() |
![]() |