Home » Developer & Programmer » JDeveloper, Java & XML » how to generate an XML doc and store it in a table
how to generate an XML doc and store it in a table [message #91787] Mon, 17 February 2003 15:31 Go to next message
darth
Messages: 1
Registered: February 2003
Junior Member
I have 3 tables containing data (oracle). What is the best way to read data from these tables , generate an XML document from this data and store it in another table record by record. ?

Thx
Re: how to generate an XML doc and store it in a table [message #91790 is a reply to message #91787] Wed, 19 February 2003 08:19 Go to previous message
prigano
Messages: 8
Registered: February 2003
Junior Member
There's a host of ways to do this including generating your own tags via in PL/SQL. Here's a way to dump all the records for a query into a clob. You could modify it to write the clob into a table. See the link below for the entire sample and the discussion from asktom.oracle.com

SQL> var my_xml clob
SQL> set autoprint on
SQL> declare
2 -- l_clob clob;
3 l_ctx dbms_xmlgen.ctxHandle;
4 l_sql varchar2(400);
5 begin
6 l_sql := 'select *
7 from emp
8 where rownum < 5';
9
10 l_ctx := dbms_xmlgen.newContext(l_sql);
11 :my_xml := dbms_xmlgen.getXml(l_ctx); -- or you could assign it to l_clob
12 end;
13 /
Previous Topic: Re: Error : What is Systemerror 126
Next Topic: Re: Fail to convert between UTF8 and UCS2: failUTF8Conv
Goto Forum:
  


Current Time: Tue Jul 27 23:13:00 CDT 2021