Results 1 to 3 of 3

Thread: Column type

  1. #1
    Join Date
    Nov 2003

    Unanswered: Column type

    I want to create a table with one of the columns to be able to store text and possibly graphics(print Screen) is this possible with one of the data types in DB2?

    I see the available data types I can choose from and I would guess VARGRAPHIC would do this for me but can't find anything to support my assumption, I also noticed there is a GRAPHIC, BLOB, CLOB, and DBCLOB types. Can someone please suggest how I should handle this best and if possible.

  2. #2
    Join Date
    Jan 2005
    GRAPHIC in DB2 terminology means a character column where each character takes two bytes to store - a bit like Unicode's UCS-2.

    The real problem you have is if you want to store a set of characters, then presumably you want them translated into the character set that the user actually has. Some characters use different byte-codes (called "code points") depending on the character set used (quite apart from the "ASCII uses 0x41 to store the character capital-A while EBCDIC uses 0xC1" problem). You may notice in some forums you see funny characters. Often this is because the characters have not been translated.

    However if you are storing a screen image you are storing a bit string and do not want any translation.

    If you really want to do this in one column, I would use either VARCHAR(nn) FOR BIT DATA (maybe using several rows to store one image) or a BLOB (with the management issues that all LOB columns have). In neither case will DB2 do any character translations - you'll have to manage that yourself.

    James Campbell

  3. #3
    Join Date
    May 2003
    If you are developing a system that has high transactions rates and needs high performance, stay away from BLOB's and CLOB's if possible. They don't use DB2 bufferpools and require direct synchronous reads/writes to disks. At the very least, put them on a high performance disk drive with sophisticated disk caching. But if your data is too large to fit in a VARCHAR, you may not have much choice.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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