|
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 |
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 /
|
|
|