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!

how to create xml file in oracle plsql

siva_pviAug 21 2015 — edited Aug 21 2015

Hi,

   I need the below xml(abc.xml) file in out_directory of unix server(out_directory path: /u01/apps/xml/)

select sivauser,sivapwd from sivainformations;---this will be multiple records

select telepone from sivatelepone;---this will be multiple records

select versionid from xyzverion;---this will be multiple records

based on the above info i need the below xml file using oracle plsql procedure or block

sample: suppose one records

<?xml version="1.0" encoding="UTF-8" ?>
<sivaService version="2.0" xmlns="http://www.siva.ab/siva/4.0/test">
<Data language="DEU">
   <Action sivauser="siva3" sivapwd="siva123"> -----i need records from sivainformations table(sivauser,sivapwd)
   <sivatelepone>telepone</sivatelepone> -----i need records from sivatelepone table(telepone) based on the sivauser column
    <abcversion version="1.0">
      <Productinfo>
        <xyzverion>versionid</xyzverion>  --------i need records from xyzverion(versionid) table based on the sivauser column
      </Productinfo>
    </abcversion>
   </Action>
</Data>
</sivaService>


sample: suppose multiple records

<?xml version="1.0" encoding="UTF-8" ?>
<sivaService version="2.0" xmlns="http://www.siva.ab/siva/4.0/test>
<Data language="DEU">
   <Action sivauser="siva3" sivapwd="siva123"> -----i need records from sivainformations table(sivauser,sivapwd)
   <sivatelepone>"345678"</sivatelepone> -----i need records from sivatelepone table(telepone) based on the sivauser column
    <abcversion version="1.0">
      <Productinfo>
        <xyzverion>"1.1"</xyzverion>  --------i need records from xyzverion(versionid) table based on the sivauser column
      </Productinfo>
    </abcversion>
   </Action>

   <Action sivauser="siva4" sivapwd="siva123"> -----i need records from sivainformations table(sivauser,sivapwd)
   <sivatelepone>"123456"</sivatelepone> -----i need records from sivatelepone table(telepone) based on the sivauser column
    <abcversion version="1.0">
      <Productinfo>
        <xyzverion>"1.2"</xyzverion>  --------i need records from xyzverion(versionid) table based on the sivauser column
      </Productinfo>
    </abcversion>
   </Action>
</Data>
</sivaService>

pls help me

Thanks
Siva

This post has been answered by Karthick2003 on Aug 21 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2015
Added on Aug 21 2015
2 comments
268 views