-1

I need some help as I'm new to dbms_xmldom. I want to write the output every 1000 records to a file, so getting it from the getclobval and writing/appending it to the file.

What should I be looking at to do this? My database is 11g release 1.

Thanks in adavance to any replies I get.

BEGIN

FOR production_rec IN c_production                       
LOOP

   loop_counter := loop_counter + 1;

   use dbms_xmldom to process database fields into l_domdoc
   ............


    IF loop_counter = 1000 THEN

            l_xmltype := dbms_xmldom.getXmlType(l_domdoc);
            dbms_xmldom.freeDocument(l_domdoc);

            dbms_output.put_line(l_xmltype.getClobVal);
            loop_counter := 0;

            instead of dbms_output.put_line i need to output/append the data to a file.

            how is this done?

    END IF;

END LOOP;

END;
Shaun Kinnair
  • 495
  • 2
  • 10
  • 27
  • You mean [something like this](http://stackoverflow.com/a/1434527/266304)? Once you have a CLOB it doesn't matter that it's XML, or how you generated it. You can only write to files on the DB server though; if you want to write to a file on your PC then SQL Developer can export the result of a query; I'm sure other clients can do the same. – Alex Poole Mar 22 '16 at 12:09
  • Yes, that could be it, I'll take a look at this tomorrow. – Shaun Kinnair Mar 22 '16 at 18:36

1 Answers1

0

You may use ut_file package to write the clob to an xml or any other file