Pretty print XML data within Oracle Databases

June 5, 2013 by Michael

Just a short post without further explanation.

Pretty printing xml in Oracle 10g and 11g differences quite a bit:

10g:

SELECT XMLTYPE('<html><body><p>Hallo, Welt.</p></body></html>').EXTRACT('/') FROM dual;

11g:

SELECT XMLSERIALIZE(Document XMLTYPE('<html><body><p>Hallo, Welt.</p></body></html>') AS CLOB INDENT SIZE = 2) FROM dual;

No comments yet

Post a Comment

Your email is never published nor shared. Required fields are marked *