Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create XML file from Oracle Store Procedure

user13329734Feb 21 2014 — edited Mar 3 2014

Need to create one generic stored procedure which will take table name as input parameter and create xml file with below format.

Xml file name should be table name.

<XML>
<TABLENAME></TABLENAME>
<RECORDS>
<RECORD>
          <COLNAME>AAA</COLNAME>
          <COLNAME>AAA</COLNAME>
<RECORD>
<RECORD>
          <COLNAME>AAA</COLNAME>
          <COLNAME>AAA</COLNAME>
<RECORD>
<RECORD>
          <COLNAME>AAA</COLNAME>
          <COLNAME>AAA</COLNAME>
<RECORD>
<RECORD>
          <COLNAME>AAA</COLNAME>
          <COLNAME>AAA</COLNAME>
<RECORD>
<RECORD>
          <COLNAME>AAA</COLNAME>
          <COLNAME>AAA</COLNAME>
<RECORD>
</RECORDS>
</XML>
 

<TABLENAME>  = actual table name(case should be same as in database)

<COLNAME> = actual column names from table(case should be same as in database)

Keep other tags as it is. Repeat <RECORD> tag for each row retrieved.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2014
Added on Feb 21 2014
5 comments
2,891 views