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