Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How parse XML in PLSQL or java and generate dynamic SQL from it
Originally posted by Ksprasadreddy
> 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</UIDACCOUN-
> T></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>1-
> 0</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
Go to http://tahiti.oracle.com and look up Oracle supplied packages like dbms_xmlxxx. I believe there is a package called dbms_xmlparser which may be what you are looking for.
Regards
/Rauf Sarwar
-- Posted via http://dbforums.comReceived on Fri Sep 12 2003 - 19:54:43 CDT
![]() |
![]() |