Home » SQL & PL/SQL » SQL & PL/SQL » dbms_xmldom.writetofile(DOMDocument,path)
dbms_xmldom.writetofile(DOMDocument,path) [message #397117] Thu, 09 April 2009 02:03 Go to next message
Messages: 101
Registered: November 2007
Location: Chennai
Senior Member
I have tried the Following PL/SQL Code.
doc dbms_xmldom.DOMDocument;
xt xmltype;
cursor cur1 is 
select xmlconcat(xmlelement("EDETAILS",xmlelement("EMPNO",empno),xmlelement("EMPNAME",ename))) from emp;
open cur1;
fetch cur1 into xt;
exit when cur1%notfound;
doc := dbms_xmldom.newDOMDocument(xt);
end loop;
close cur1;

Emp table has 5 Records .
1	8786	BALU
2	85978	RAMESH
3	23	23
4	555	RAJ
5	7678	BALAJI

but all the 5 records are not writing into the file. The file is having only 1 record
can anyone tell me what i have to do to display all 5 records in the file?

[Updated on: Thu, 09 April 2009 02:07]

Report message to a moderator

Re: dbms_xmldom.writetofile(DOMDocument,path) [message #397120 is a reply to message #397117] Thu, 09 April 2009 02:16 Go to previous message
Michel Cadot
Messages: 65144
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I'm not sure but I think you overwrite your file at each loop and so only have the last row in it.

Previous Topic: Record Generation
Next Topic: Search particular object used in any of my PL/SQL code (merged 3)
Goto Forum:

Current Time: Sun Aug 20 06:48:53 CDT 2017

Total time taken to generate the page: 0.11712 seconds