Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turning a Oracle Recordset into XML

Status
Not open for further replies.

Dynapen

Programmer
Apr 20, 2000
245
US
Here's the problem I am having. I need to have Oracle build me a recordset off of a SQL statment I am passing, but to pass me the recordset back as a XML document. I believe that it can be done, but I can't find a single example of how. Without that, I have to set my webserver to build a XML doc out of the recordset, and then pass it on, so I am doubling my work on the webserver.

Does anyone know how to do this, or of a good source to use to find out for sure? The money's gone, the brain is shot.....but the liquor we still got.
 
Try to use xmlgen.getxml function.
 
Where is this function located. On the DB Side? Applicaiton Server Side?

And is there anywhere I can get some info on it? The money's gone, the brain is shot.....but the liquor we still got.
 
You may find all the info in oracle manuals. XMLGEN is server side pl/sql package and GETXML is a function, that accepts select statement as a string (varchar2) and returns the result XML as CLOB. The package contains also a number of useful functions to format results and call DML commands using XML.
 
If you haven't done already , Down Load the XDK from the Oracle site, install it. There is a test to confirm if the XDK installed correctly.
You will get dbms_xmlquery.getxml() , which takes SQL and output an XML.
For the DTD you will have to use dbms_xmlquery.getdtd('SQL Query')
HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top