Home » SQL & PL/SQL » SQL & PL/SQL » generate and xml file
generate and xml file [message #229788] Tue, 10 April 2007 01:20 Go to next message
soujanya_srk
Messages: 111
Registered: November 2006
Location: HYDERABAD
Senior Member
i am trying to generate an xml file.....

for eg i have a customer table with custid, custname etc...

lets say the custid col has data (sequence) 1 to 10

i want to generate an xml file., which has ALL COLUMNS of
customer table (custid,custname)....with the data from 11 to
20..

i have gone thru xmlelement function etc, but i am very new to
xml...and i need some help to generate an xml file..

any help is appreciated

Re: generate and xml file [message #229789 is a reply to message #229788] Tue, 10 April 2007 01:22 Go to previous messageGo to next message
soujanya_srk
Messages: 111
Registered: November 2006
Location: HYDERABAD
Senior Member
and i need this xml file, because i want it to use it as a source
to load data into the same customer table later on...

Re: generate and xml file [message #229797 is a reply to message #229788] Tue, 10 April 2007 01:39 Go to previous message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select dbms_xmlquery.getxml('select * from emp where rownum <= 3') from dual;
DBMS_XMLQUERY.GETXML('SELECT*FROMEMPWHEREROWNUM<=3')
--------------------------------------------------------------------------------------
<?xml version = '1.0'?>
<ROWSET>
   <ROW num="1">
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7902</MGR>
      <HIREDATE>12/17/1980 0:0:0</HIREDATE>
      <SAL>800</SAL>
      <DEPTNO>20</DEPTNO>
   </ROW>
   <ROW num="2">
      <EMPNO>7499</EMPNO>
      <ENAME>ALLEN</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>2/20/1981 0:0:0</HIREDATE>
      <SAL>1600</SAL>
      <COMM>300</COMM>
      <DEPTNO>30</DEPTNO>
   </ROW>
   <ROW num="3">
      <EMPNO>7521</EMPNO>
      <ENAME>WARD</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>2/22/1981 0:0:0</HIREDATE>
      <SAL>1250</SAL>
      <COMM>500</COMM>
      <DEPTNO>30</DEPTNO>
   </ROW>
</ROWSET>

Regards
Michel
Previous Topic: Privileges for using execute immediate or dbms_sql for DDL in Pl/SQL block
Next Topic: COMMIT IN TRIGGERS
Goto Forum:
  


Current Time: Fri Dec 09 10:01:50 CST 2016

Total time taken to generate the page: 0.13555 seconds