467,199 Members | 981 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,199 developers. It's quick & easy.

GRAPHIC and VARGRAPHIC encoding

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
  • viewed: 6599
Share:
1 Reply
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.

Similar topics

11 posts views Thread by Al Franz | last post: by
20 posts views Thread by Joe exCSSive | last post: by
1 post views Thread by Peter | last post: by
2 posts views Thread by David Scemama | last post: by
1 post views Thread by icepick72@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.