Print Thread
xmltype return empty xml
#33698 03/28/09 05:49 AM
Joined: Mar 2009
Posts: 1
W
Member
OP Offline
Member
W
Joined: Mar 2009
Posts: 1
Something interesting on using PL/SQL Deveoper 7.1.5.1397.
Not sure anyone knows, but it may be only on our oracle database.

try this
select xmltype('<Hello></Hello>') from all_tables;

I have a bunch of rows returned, but at row 7, the xml is empty.

can someone verify this?

Cheers

Wallace

Re: xmltype return empty xml
WallaceLee #33701 03/30/09 06:37 AM
Joined: Jan 2003
Posts: 97
Denmark
B
Member
Offline
Member
B
Joined: Jan 2003
Posts: 97
Denmark
I have the same behaviour on an 11g database. Furthermore, if I execute the following select:

Code
select xmltype('<Hello></Hello>'), 
       xmltype('<Hello></Hello>').getstringval()
  from all_tables;
then the seventh row displays data for the string value but the clob for the XMLtype is empty. When executed in SQL*plus all data is returned. Seems to me to be a problem with the display of the results and not the query in it self. So getstringval or getclobval can be used to see the result.

Bo

Last edited by Bo Pedersen; 03/30/09 06:43 AM.
Re: xmltype return empty xml
Bo Pedersen #33710 03/30/09 09:58 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
Works fine for me. Can you let me know your Oracle Client version?


Marco Kalter
Allround Automations
Re: xmltype return empty xml
Marco Kalter #33724 03/31/09 06:15 AM
Joined: Jan 2003
Posts: 97
Denmark
B
Member
Offline
Member
B
Joined: Jan 2003
Posts: 97
Denmark
My Oracle Client is:

Oracle Database 11g Enterprise Edition Release 11.1.0.7.0

I ran the script against a local 11g database.

I also tried it against an Oracle9i Enterprise Edition Release 9.2.0.1.0 database which resulted in PL/SQL Developer crashing. But in previous versions of the Oracle Database and/or PL/SQL Developer I think it was needed to use getclobval or getstringval to avoid an internal Oracle error.

I am using PL/SQL Developer version 7.1.5.1398.

Bo

Re: xmltype return empty xml
Bo Pedersen #33728 03/31/09 01:36 PM
Joined: Jul 2004
Posts: 592
W
Member
Offline
Member
W
Joined: Jul 2004
Posts: 592
I get the same result. The 7th row shows a non-null "<CLOB>", but clicking into the large data editor shows that it's empty.

Oracle Database 11g Release 11.1.0.7.0
Oracle Client 10.2.0
PL/SQL Developer 7.1.5.1398

In case it matters, the 7th row's info from all_tables is owner='SYS', table_name='COLTYPE$'. I don't think it matters, because if I only select that row, the problem goes away. However, if I add an ORDER BY, the problem goes away as well.

Re: xmltype return empty xml
Worker #33736 04/01/09 03:24 PM
Joined: Apr 2009
Posts: 2
M
Member
Offline
Member
M
Joined: Apr 2009
Posts: 2
I get the same problem using the xmlelement() function. i.e.

select xmlelement ("root", xmlattributes( person_id, last_name, first_name)) from person

The 7th row is a <CLOB> but when I open it up, it is empty. Other rows have a <Value Error> error. The empty <CLOB> value also appears on rows 37, 107, 137, 207, etc.

I am using PL/SQL Dev 7.1.1.1339 and oracle client v10.2.


Re: xmltype return empty xml
Worker #33737 04/01/09 03:24 PM
Joined: Apr 2009
Posts: 2
M
Member
Offline
Member
M
Joined: Apr 2009
Posts: 2
edit: dup post


Last edited by matt_bae; 04/01/09 03:25 PM.

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.054s Queries: 13 (0.014s) Memory: 2.5251 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-18 21:27:34 UTC
Valid HTML 5 and Valid CSS