Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DB2 Unicode ?

75 views
Skip to first unread message

bernd hohmann

unread,
Oct 14, 2001, 3:50:38 PM10/14/01
to
does v6 FP8 provide unicode support ?

i tried it with OS/2 warp 4.5 (eBusiness server) and failed :-(

bernd

--
the DB2 faq: http://www.harddiskcafe.de/db2faq/index.html

Sherman Lau

unread,
Oct 15, 2001, 9:30:32 AM10/15/01
to
It should. What are you trying to do?

Sherman

"bernd hohmann" <hoh...@harddiskcafe.de> wrote in message
news:ubuznaauneqqvfxpns...@news.cis.dfn.de...

bernd hohmann

unread,
Oct 15, 2001, 1:11:30 PM10/15/01
to
On Mon, 15 Oct 2001 09:30:32 -0400, Sherman Lau wrote:

> It should. What are you trying to do?

codepage = 1200
territory = DE

got a message like 'no codepage "" not found, territory "" not
found'.

wondering about the "" in the message.

Sherman Lau

unread,
Oct 16, 2001, 11:23:58 AM10/16/01
to
Hi Bernd,

I guess you are trying to create a Unicode database. Details can be found
in Admin Guide - Planning. Appendix - National Language Support
Consideration.

The create database command is shown as follows:
db2 create database <databaseName> using codeset UTF-8 territory DE

To become a Unicode client:
db2set db2codepage=1208

There is no parameter called codepage in the create database command.
Correct me if you are not trying to create a Unicode database. Your problem
description is abstract.

Sherman

"bernd hohmann" <hoh...@harddiskcafe.de> wrote in message
news:ubuznaauneqqvfxpns...@news.cis.dfn.de...

bernd hohmann

unread,
Oct 16, 2001, 1:51:06 PM10/16/01
to
On Tue, 16 Oct 2001 11:23:58 -0400, Sherman Lau wrote:

> The create database command is shown as follows:
> db2 create database <databaseName> using codeset UTF-8 territory DE
>
> To become a Unicode client:
> db2set db2codepage=1208

sure, i did it. i successfully managed it to keep a IBM-850 and a
IBM-857 database on the same machine.

my problem: i have to store turkish (IBM-857) and german (IBM-850)
data in the same database.

when using UTF-8 (which isn't "real" unicode) i run into the
following problem: inserting data will fail if there is any UTF-8
conversion (the insert fails with "Data right truncated".

why ? i think that somebody is padding the string to the length of
the used CHAR field and THEN the IBM-850 to UTF-8 conversion is done.
if there is a char beyond 127, it will need two chars causing a
growth of the record beyond the given size.

thats why i try to use double byte "true" unicode.

Sherman Lau

unread,
Oct 16, 2001, 6:04:12 PM10/16/01
to
> why ? i think that somebody is padding the string to the length of
> the used CHAR field and THEN the IBM-850 to UTF-8 conversion is done.
> if there is a char beyond 127, it will need two chars causing a
> growth of the record beyond the given size.
CHAR is fixed length character field. DB2 will blank padded shorter string
to the fixed length field. Thus this is working as design. varchar data
type will not be blank padded.

Besides, Unicode client connecting to non-Unicode databases was not
supported in DB2 v6 as stated in DB2 UDB Admin Guide.

> thats why i try to use double byte "true" unicode.

If you want to use double type Unicode, UCS-2, then use graphic datatype.
Graphic data type is encoded in UCS-2 and Char data type is encoded in
UTF-8.

Thus setting db2codepage=1208, DB2 actually supports both UCS-2 and UTF-8
Unicode encodings.

Sherman


bernd hohmann

unread,
Oct 16, 2001, 8:20:27 PM10/16/01
to
On Tue, 16 Oct 2001 18:04:12 -0400, Sherman Lau wrote:

> CHAR is fixed length character field. DB2 will blank padded shorter string
> to the fixed length field.

sure, but this should not be a matter of codepages (means: a char is
a char is a char)

> Thus this is working as design. varchar data type will not be blank padded.

i tested it again and also varchar has this behaviour. i will check
the code of the IBM jdbc-driver tomorrow if there is something
broken.

> Besides, Unicode client connecting to non-Unicode databases was not
> supported in DB2 v6 as stated in DB2 UDB Admin Guide.

as read in the DB2 docs, the double-byte unicode UCS-2 is IBM
codepage 1200 and i set it carefully everywhere.

> > thats why i try to use double byte "true" unicode.
> If you want to use double type Unicode, UCS-2, then use graphic datatype.
> Graphic data type is encoded in UCS-2 and Char data type is encoded in
> UTF-8.

i thought that a EEE 4 processor license with all extensions will
handle this alone - you know the price for that licence ?

Sherman Lau

unread,
Oct 17, 2001, 9:37:08 AM10/17/01
to
Hi Bernd,

> as read in the DB2 docs, the double-byte unicode UCS-2 is IBM
> codepage 1200 and i set it carefully everywhere.

DB2CODEPAGE cannot be set to 1200.

If DB2CODEPAGE=1208 is set,
the char/varchar/long varchar/clob data type is encoded in UTF-8
(code page 1208), and the graphic/vargraphic/long vargraphic/dbclob
data type (i.e. sqldbchar in your application) is encoded in UCS-2
(code page 1200).

> i thought that a EEE 4 processor license with all extensions will
> handle this alone - you know the price for that licence ?

Sorry I don't know about pricing. I guess you need to talk to the
sales rep.

Sherman


0 new messages