Generate xml from table data--oracle 12c -
how generate below xml. requirement self close tag productiondata.
required output--
<header> <meterunit sno="1" meterid="121"> <productiondata manufacture="abc"/> </meterunit> </header> table details: tablename: meterinfo. columnname: sno, meterid, manufacture. data:1 121 abc
my query--
select xmlelement("header", xmlelement("meterunit",xmlattributes(sno sno, meterid meterid),xmlelement("productiondata",xmlattributes(manufacture manufacture)))) meterinfo;
my output
<header> <meterunit sno="1" meterid="121"> <productiondata manufacture="abc"></productiondata> </meterunit> </header>
don't use xmlroot, introduced placeholder while xmlserialize() function being standardized. appear want add xml declaration. function of xml serialization , should added using xmlserialize(), turns xml object text..
Comments
Post a Comment