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 > Column type

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-05, 12:28
tmacksam tmacksam is offline
Registered User
 
Join Date: Nov 2003
Posts: 18
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.
Reply With Quote
  #2 (permalink)  
Old 02-10-05, 20:53
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
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
Reply With Quote
  #3 (permalink)  
Old 02-10-05, 21:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
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