Database Utilities (MOSC)

MOSC Banner

dbms_xmlgen.getxml

edited Jun 17, 2013 6:01AM in Database Utilities (MOSC) 3 commentsAnswered
 Hi, 
I'm currently using dbms_xmlgen.getxml to convert a query dataset into XML format. However, I am looking to add the datatype of the column into the XML.

For example:
select dbms_xmlgen.getxml('SELECT C_NUMBER, C_STRING, C_DATE FROM table1') from dual produces 
<?xml version="1.0"?>
<ROWSET>
 <ROW>
  <C_NUMBER>1234</C_NUMBER>
  < C_STRING >ABCS</ C_STRING>
  < C_DATE >01-JAN-2012</ C_DATE>
 </ROW>
</ROWSET>


I am looking for something along the lines of output:

<?xml version="1.0"?>
<ROWSET>
 <ROW>
  <C_NUMBER><DT="NUMBER">1234</DT></C_NUMBER>
  < C_STRING ><DT="VARCHAR2">ABCS</DT></ C_STRING>
  < C_DATE ><DT="DATE">01-JAN-2012</DT></ C_DATE>

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center