Monthly Archives: June 2013

Pretty print XML data within Oracle Databases


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;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;select XMLSERIALIZE(Document XMLTYPE(‘<html><body><p>Hallo, Welt.</p></body></html>’) as CLOB INDENT SIZE = 2) from dual;

Read the complete article »