By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,004 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,004 IT Pros & Developers. It's quick & easy.

GRAPHIC and VARGRAPHIC encoding

P: n/a
My understanding is that GRAPHIC and VARGRAPHIC data types can store
text encoded in UCS-2 in a Unicode database (ie when it is created so
that CHAR is encoded in UTF-8).

What is the encoding of GRAPHIC in a non Unicode database ? I have not
found any documentation that explains this clearly.

Thanks

David
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
GRAPHIC (and VARGRAPHIC) in a non-Unicode database will store character
values as 16 bits per character. This is explicitly stated in the SQL
Reference, Vol 1. (I also suspect that some characters take 32 bits each
- see the next paragraph.)

In a UTF-8 database; "standard" ASCII characters in columns defined with
these types are stored as single byte data. Characters outside the
"standard" ASCII set are stored as two (or more as needed) bytes per
character. See the "Administration Guide: Planning", "Unicode character
encoding" and following sections in Appendix B for additional details.

The worst problem I had working with a UTF-8 database was using DB2LOOK
to copy statistics. The HIGH2KEY and LOW2KEY column values did not
correctly reload to the statistics columns. My recollection is that this
was caused by storing graphic data (the column content) in a char
column (ie HIGH2KEY).

Phil Sherman
Lopezd9 wrote:
My understanding is that GRAPHIC and VARGRAPHIC data types can store
text encoded in UCS-2 in a Unicode database (ie when it is created so
that CHAR is encoded in UTF-8).

What is the encoding of GRAPHIC in a non Unicode database ? I have not
found any documentation that explains this clearly.

Thanks

David


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.