If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Large XML Result

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-27-07, 09:52
emansour emansour is offline
Registered User
 
Join Date: Jul 2007
Posts: 6
Large XML Result

Hi,

I am using the DB2 Command Editor to run an XQuery that returns a large XML result.

the problem is that the result is truncated, so I see only a part of the XML document.

I understand that it might be the buffer size is not large enough to keep the whole result.

How can I solve this problem?

I am using DB2 express running on Ubuntu 7.04

Thank you very much in advance.
Essam
Reply With Quote
  #2 (permalink)  
Old 09-29-07, 12:51
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
I'm not sure if this also applies to the Command Editor, but the DB2 CLP truncates LOBs and XML documents to 4 or 8K. This cannot be changed.

The background is that the CLP doesn't want to write out up to 2GB of data when a table containing such data is queried. If you need the full data, you usually have an application anyways and don't look at it on the CLP in detail.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 09-29-07, 13:13
nidm nidm is offline
Registered User
 
Join Date: May 2003
Posts: 113
Quote:
Originally Posted by stolze
I'm not sure if this also applies to the Command Editor, but the DB2 CLP truncates LOBs and XML documents to 4 or 8K. This cannot be changed.

The background is that the CLP doesn't want to write out up to 2GB of data when a table containing such data is queried. If you need the full data, you usually have an application anyways and don't look at it on the CLP in detail.
Agree. A good alternative is to use an application(like java) to grab the result.

I am not sure whether this works: if DB2/LUW have xmlserialize or xml2clob function, you can use this function to get lob result first.
Reply With Quote
  #4 (permalink)  
Old 09-30-07, 10:45
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Converting XML to CLOBs is possible, of course, but you will have the limitations applicable for LOBs that I mentioned.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 10-01-07, 06:47
emansour emansour is offline
Registered User
 
Join Date: Jul 2007
Posts: 6
thank you very much.

I will try to make it using a java application.

I was using Oracle 10g, in which I can run a command to enlarge the size to let the complete result appear. I thought there is something like that in DB2.

Essam
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On