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 > XML - BLOB datatype

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-09, 22:51
sgmane sgmane is offline
Registered User
 
Join Date: Jul 2005
Posts: 19
XML - BLOB datatype

Hi,

Environment:
DB2 : 9.x
unix: aix

We are storing XML in BLOB data type.

We need to display XML (which is stored in BLOB data type) in some JSP.

While displaying the XML, we are not able to see some special characters related to UTF-8 encoding (Ex: β).

If the same character is stored in some varchar datatype, then we are able to display the content properly.

BLOB - used for images.
This field in the table has been created with BLOB and can it be displayed as required.

Anything to do with character set? But i did see BLOB does not require any character set. And i suppose BLOB column should be created in separate table, is it so?

Can any of you show me a lead?

thanks
Reply With Quote
  #2 (permalink)  
Old 02-13-09, 15:53
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
A BLOB stores binary data, i.e. DB2 will not do any code page conversions. Therefore, you get returned what you put in and you have to look at your application for the source of your problems.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 02-13-09, 16:59
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
It is best to use varchar if you keep in under 32K (row size has to be under 32K also) so that it can use DB2 bufferpools. LOB data uses synchronous I/O to disk for reads and writes (at least make sure you have OS file system caching enabled for a lob tablespace).

If over 32K, use a CLOB for XML data.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 02-16-09, 04:56
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Another alternative is to wrap the BLOB into a structured type. Then you get the benefits of buffer pools for small objects (fitting into the page) and you can also handle large objects that exceed the page size (or rather the "inline length").
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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