Objective:
Generate XML data from relational data using oracle provided standard packages.
Prerequisite:
DBMS_XMLGEN.GETXML (
sqlQuery IN VARCHAR2,
dtdOrSchema IN number := NONE)
return clob;
Converts the results from the SQL query string to XML format, and returns the XML as a temporary CLOB.
Solution:
DBMS_XMLGEN.GETXML (
sqlQuery IN VARCHAR2,
dtdOrSchema IN number := NONE)
return clob;
Converts the results from the SQL query string to XML format, and returns the XML as a temporary CLOB.
Solution:
SELECT dbms_xmlgen.getxml('select * from emp') xml
FROM dual;
This query will give you the complete XML structure output of the table along with its data.
Output:
Related Posts:
Great post bro thanks for sharing.
ReplyDeleteThanks Sameer
Delete