I have a requirement . I need to query a table and display the column value by transforming escape character into XML format example " & " to "&"
Details
I have table name "AppName"
select NAME from AppName
NAME
---------
Oracle & Database
What i need to do is get the output in XML compliant format. something like below eg:
NAME
------
Oracle & Database
I have used the DBMS_XMLGEN to make it XML Complaint and trying to using extractvalue to get the value. but it return as "Oracle & Database"
Below is query to transform to XML format
select SYS.DBMS_XMLGEN.getXML( 'select NAME from APPName ') XML_out from dual
"<?xml version="1.0"?>
<ROWSET>
<ROW>
<NAME>Oracle & Database<NAME>
</ROW>
</ROWSET>
"
And then i try to extract the Name
select extractvalue( XMLType.createXML(SYS.DBMS_XMLGEN.getXML( 'select NAME from APPNAme' )),'/ROWSET/ROW/NAME') XML_out from dual
which return back the output same as "Oracle & Database"
But i need output as "Oracle & Database"
How can i get this output using DBMS_XMLGEN or is there is any easy way.
Any help is greatly appreciated