Hi,
I have tried the Following PL/SQL Code.
declare
doc dbms_xmldom.DOMDocument;
xt xmltype;
cursor cur1 is
select xmlconcat(xmlelement("EDETAILS",xmlelement("EMPNO",empno),xmlelement("EMPNAME",ename))) from emp;
begin
open cur1;
loop
fetch cur1 into xt;
exit when cur1%notfound;
doc := dbms_xmldom.newDOMDocument(xt);
dbms_xmldom.writetofile(doc,'/tmp/s1.txt');
end loop;
close cur1;
end;
Emp table has 5 Records .
EMPNO ENAME
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 <EDETAILS>
<EMPNO>7678</EMPNO>
<EMPNAME>BALAJI</EMPNAME>
</EDETAILS>
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