Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2005
    Posts
    19

    Unanswered: 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

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •