Comments on: XMLType and DBMS_OUTPUT https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/ Friends of Oracle and Java Thu, 23 Apr 2015 12:54:46 +0000 hourly 1 http://wordpress.org/?v=4.2 By: Dan Brown https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3767 Wed, 04 Apr 2007 11:55:00 +0000 http://technology.amis.nl/blog/?p=1307#comment-3767 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 https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3766 Thu, 26 Oct 2006 08:44:43 +0000 http://technology.amis.nl/blog/?p=1307#comment-3766 See the XMLDB forum: http://forums.oracle.com/forums/search.jspa?objID=f34&q=ora-31011 for ideas

]]>
By: Niles https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3765 Wed, 25 Oct 2006 00:17:28 +0000 http://technology.amis.nl/blog/?p=1307#comment-3765 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 https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3764 Mon, 18 Sep 2006 09:03:57 +0000 http://technology.amis.nl/blog/?p=1307#comment-3764 Hi Han,
I think this has to do with the SQL*Plus client that you use. At this site, I use SQL*Plus: Release 9.2.0.6.0 and it yields this result:
SQL> select XMLElement(“TheDate”, sysdate) from dual;

XMLELEMENT(“THEDATE”,SYSDATE)
—————————————————–

18-SEP-06

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

]]>
By: Han Kulker https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3763 Fri, 15 Sep 2006 13:55:38 +0000 http://technology.amis.nl/blog/?p=1307#comment-3763 I can’t use this statement, do i need to install extra XML stuff on the database ?

SQLPlus Release 9.0.1.4.0

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

XMLELEMENT(”THEDATE”,SYSDATE)()
——————————————————————————–
XMLTYPE()

]]>
By: Alex Nuijten https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3762 Mon, 21 Aug 2006 07:59:32 +0000 http://technology.amis.nl/blog/?p=1307#comment-3762 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 https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3761 Sat, 19 Aug 2006 01:43:28 +0000 http://technology.amis.nl/blog/?p=1307#comment-3761 For “extract” and “pretty print” see also http://forums.oracle.com/forums/search.jspa?objID=f34&q=extract+pretty+print

]]>
By: Marco Gralike https://technology.amis.nl/2006/08/07/xmltype-and-dbms_output/#comment-3760 Sat, 19 Aug 2006 01:39:36 +0000 http://technology.amis.nl/blog/?p=1307#comment-3760 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).

]]>