Comments on: XMLType and DBMS_OUTPUT Friends of Oracle and Java Thu, 23 Apr 2015 12:54:46 +0000 hourly 1 By: Dan Brown Wed, 04 Apr 2007 11:55:00 +0000 Thanks for this, I was racking my head how to pretty-print some XML out of an XMLTYPE (it seems to lose all formatting as soon as you do an XMLTYPE function on it – e.g. UPDATEXML etc) and now I can just use the EXTRACT(‘/*’) ! Marvellous!

By: Marco Gralike Thu, 26 Oct 2006 08:44:43 +0000 See the XMLDB forum: for ideas

By: Niles Wed, 25 Oct 2006 00:17:28 +0000 RE: executing
select XMLElement(”TheDate”, sysdate) from dual

> ok if your database is not UTF-8
> errors with ‘ora-31011 xml parsing failed’ if database is UTF-8
I have yet to find out what’s causing this is and what the solution/workaround is…

By: Alex Nuijten Mon, 18 Sep 2006 09:03:57 +0000 Hi Han,
I think this has to do with the SQL*Plus client that you use. At this site, I use SQL*Plus: Release and it yields this result:
SQL> select XMLElement(“TheDate”, sysdate) from dual;



I do remember that we used to have an older version and it would show the XMLTypes as you describe.

By: Han Kulker Fri, 15 Sep 2006 13:55:38 +0000 I can’t use this statement, do i need to install extra XML stuff on the database ?

SQLPlus Release

SQL> select XMLElement(”TheDate”, sysdate) from dual;


By: Alex Nuijten Mon, 21 Aug 2006 07:59:32 +0000 Thanks Marco for this link to the Forums! Like I said my Google skills aren’t that great. I would never thought of using “pretty print” as a search term.
Changing the Long to a LOB? Probably. Maybe it would suffice to use VARCHAR2… I can’t get used to DBMS_LOB to manipulate Lobs…

By: Marco Gralike Sat, 19 Aug 2006 01:43:28 +0000 For “extract” and “pretty print” see also

By: Marco Gralike Sat, 19 Aug 2006 01:39:36 +0000 Alex,

wouldn’t it be better to use “clob” instead of your “long” datatype (l_str=long; – anyway will the long data type not be depricated, despite the fact that is a nasty datatype to handle)?.

The pretty print is caused because you used “extract(’/*’)” this (=extract) will give the layout you want, or not want, pretty print layout is the default behaviour for “extract” (you can alter this behaviour if you are using XML schemas and using a high Oracle 10.2.x version).