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

Home -> Community -> Usenet -> c.d.o.server -> Re: Parsing xml with PL/SQL

Re: Parsing xml with PL/SQL

From: Scott Mattes <Scott_at_TheMattesFamily.ws>
Date: Thu, 06 Mar 2003 21:13:45 GMT
Message-ID: <dSO9a.4986$J51.983734@news1.news.adelphia.net>


use a pl/sql table of records of type node

use instr and substr

pass 'emp', 'empno', 'ename' to the procedure

although CLOBs might change some of that a little.

"Hosie" <kowens_at_datascantech.com> wrote in message news:3b3aecf9.0303060631.43084344_at_posting.google.com...
> I am a newbie using XML with PL/SQL. I would like to pass XML as a
> CLOB to a stored procedure, parse the nodes in a loop and insert or
> update records. Something like this:
>
> The xml:
> <emps>
> <emp>
> <empno>7369</empno>
> <ename>SMITH</ename>
> </emp>
> <emp>
> <empno>7499</empno>
> <ename>ALLEN</ename>
> </emp>
> </emps>
>
> In the stored procedure:
> begin
> load xmlClob into parser p
> nodelist = p.someMethod( '/emps/emp' )
> for each node in nodelist
> insert into emp( empno, ename) values ( node.empno, node.ename
> );
> end loop
> cleanup
> end
>
> Any assistance you could provide would be greatly appreciated.
>
> TIA
Received on Thu Mar 06 2003 - 15:13:45 CST

Original text of this message

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