dbTalk Databases Forums  

Support for multiple char sets?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Support for multiple char sets? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hemant Shah
 
Posts: n/a

Default Support for multiple char sets? - 08-12-2003 , 12:46 AM







Folks,

Does DB2 support multiple charsets?

In Oracle you can set NLS_CHARACTERSET and NLS_NCHAR_CHARACTERSET
and declare a column as CHAR or NCHAR.

We are planning to migrate our application to use Unicode and would like to
use both ASCII and Unicode character at the same time.



--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.

Reply With Quote
  #2  
Old   
Sherman Lau
 
Posts: n/a

Default Re: Support for multiple char sets? - 08-12-2003 , 03:39 PM






You can just create a table with character column or graphic column. DB2
Administration Guide has details about the Unicode implementation in DB2.

E.g.
create table myTable (UTF8 varchar(10), UCS2 long graphic)

Sherman

"Hemant Shah" <shah (AT) typhoon (DOT) xnet.com> wrote

Quote:
While stranded on information super highway Sherman Lau wrote:
In the current v8, DB2 support UTF-8 and UCS-2 in a Unicode database.
Character fields such as char/varchar/long varchar/clob are encoded in
UTF-8
and graphic fields such as graphic/vargraphic/long vargraphic/dbclob are
encoded in UCS-2. The first 127 single-byte characters in UTF-8 is
exactly
the same as the ASCII invariant characters in ASCII code pages. These
characters include 0-9, a-z, A-Z, and some symbols !, ", #, $, %, &, ',
(, ), *, +,,, -,.,/,:,;,<,=,>,?,@,[,\,],^,_,`,{,|,},~ and [space].

Sherman

So how would you use different character set for different tables?


"Hemant Shah" <shah (AT) typhoon (DOT) xnet.com> wrote in message
news:bh9v09$cgf$1 (AT) flood (DOT) xnet.com...

> Folks,

> Does DB2 support multiple charsets?

> In Oracle you can set NLS_CHARACTERSET and NLS_NCHAR_CHARACTERSET
> and declare a column as CHAR or NCHAR.

> We are planning to migrate our application to use Unicode and would
like
to
> use both ASCII and Unicode character at the same time.



> --
> Hemant Shah /"\ ASCII ribbon campaign
> E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
> X against HTML mail
> TO REPLY, REMOVE NoJunkMail / \ and postings
> FROM MY E-MAIL ADDRESS.
> -----------------[DO NOT SEND UNSOLICITED BULK
E-MAIL]------------------
> I haven't lost my mind, Above opinions are mine only.
> it's backed up on tape somewhere. Others can have their own.



--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.



Reply With Quote
  #3  
Old   
Anton Versteeg
 
Posts: n/a

Default Re: Support for multiple char sets? - 08-14-2003 , 03:35 AM



The column names are UTF8 and UCS2 respectively.
No you cannot specify character sets on the create table statement,
other than chosing (var)char for utf8 and (var)graphic for ucs2. You
speciy the codepage when you create the database.

Hemant Shah wrote:

Quote:
While stranded on information super highway Sherman Lau wrote:
You can just create a table with character column or graphic column. DB2
Administration Guide has details about the Unicode implementation in DB2.

E.g.
create table myTable (UTF8 varchar(10), UCS2 long graphic)

Sherman

Is this syntax correct?
What are the names of the coumns?
Can you specify charset in create table statement?

When you create a database you can specify a code page, does UDB 8.0 support
multiple code pages?

I looked at SQL reference and Administrator guide at IBM web site, but could
not find information/example there.

Can you provide an example to page number in the guide I could look at?


Thanks.


"Hemant Shah" <shah (AT) typhoon (DOT) xnet.com> wrote in message
news:bhbe2m$qq7$1 (AT) flood (DOT) xnet.com...
> While stranded on information super highway Sherman Lau wrote:
> In the current v8, DB2 support UTF-8 and UCS-2 in a Unicode database.
> Character fields such as char/varchar/long varchar/clob are encoded in
UTF-8
> and graphic fields such as graphic/vargraphic/long vargraphic/dbclob are
> encoded in UCS-2. The first 127 single-byte characters in UTF-8 is
exactly
> the same as the ASCII invariant characters in ASCII code pages. These
> characters include 0-9, a-z, A-Z, and some symbols !, ", #, $, %, &, ',
> (, ), *, +,,, -,.,/,:,;,<,=,>,?,@,[,\,],^,_,`,{,|,},~ and [space].
>
> Sherman

> So how would you use different character set for different tables?

>
> "Hemant Shah" <shah (AT) typhoon (DOT) xnet.com> wrote in message
> news:bh9v09$cgf$1 (AT) flood (DOT) xnet.com...
>
> > Folks,
>
> > Does DB2 support multiple charsets?
>
> > In Oracle you can set NLS_CHARACTERSET and NLS_NCHAR_CHARACTERSET
> > and declare a column as CHAR or NCHAR.
>
> > We are planning to migrate our application to use Unicode and would
like
> to
> > use both ASCII and Unicode character at the same time.
>
>
>
> > --
> > Hemant Shah /"\ ASCII ribbon campaign
> > E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
> > X against HTML mail
> > TO REPLY, REMOVE NoJunkMail / \ and postings
> > FROM MY E-MAIL ADDRESS.
> > -----------------[DO NOT SEND UNSOLICITED BULK
E-MAIL]------------------
> > I haven't lost my mind, Above opinions are mine only.
> > it's backed up on tape somewhere. Others can have their own.
>
>

> --
> Hemant Shah /"\ ASCII ribbon campaign
> E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
> X against HTML mail
> TO REPLY, REMOVE NoJunkMail / \ and postings
> FROM MY E-MAIL ADDRESS.
> -----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
> I haven't lost my mind, Above opinions are mine only.
> it's backed up on tape somewhere. Others can have their own.





--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands




Reply With Quote
  #4  
Old   
Hemant Shah
 
Posts: n/a

Default Re: Support for multiple char sets? - 08-15-2003 , 10:11 AM



While stranded on information super highway Anton Versteeg wrote:
The column names are UTF8 and UCS2 respectively.
No you cannot specify character sets on the create table statement,
other than chosing (var)char for utf8 and (var)graphic for ucs2. You
speciy the codepage when you create the database.

O.K. I think I am begining to understand.

If I declare database code page as UTF-8, then the char, varchar, etc. will
use UTF-8 character set, and graphics, vargraphics, etc. will use USC2.

Is that correct?

Is there a document that will tell me the same thing about other code pages?
e.g. If the DB codepage is ISO8859-1 then what character sets are used for
char, etc. and graphics, etc.



Hemant Shah wrote:

>While stranded on information super highway Sherman Lau wrote:
>You can just create a table with character column or graphic column. DB2
>Administration Guide has details about the Unicode implementation in DB2.
>
>E.g.
>create table myTable (UTF8 varchar(10), UCS2 long graphic)
>
>Sherman
>
> Is this syntax correct?
> What are the names of the coumns?
> Can you specify charset in create table statement?
>
> When you create a database you can specify a code page, does UDB 8.0 support
> multiple code pages?
>
> I looked at SQL reference and Administrator guide at IBM web site, but could
> not find information/example there.
>
> Can you provide an example to page number in the guide I could look at?
>
>
> Thanks.
>
>
>"Hemant Shah" <shah (AT) typhoon (DOT) xnet.com> wrote in message
>news:bhbe2m$qq7$1 (AT) flood (DOT) xnet.com...
>> While stranded on information super highway Sherman Lau wrote:
>> In the current v8, DB2 support UTF-8 and UCS-2 in a Unicode database.
>> Character fields such as char/varchar/long varchar/clob are encoded in
>UTF-8
>> and graphic fields such as graphic/vargraphic/long vargraphic/dbclob are
>> encoded in UCS-2. The first 127 single-byte characters in UTF-8 is
>exactly
>> the same as the ASCII invariant characters in ASCII code pages. These
>> characters include 0-9, a-z, A-Z, and some symbols !, ", #, $, %, &, ',
>> (, ), *, +,,, -,.,/,:,;,<,=,>,?,@,[,\,],^,_,`,{,|,},~ and [space].
>>
>> Sherman
>>
>> So how would you use different character set for different tables?
>>
>>
>> "Hemant Shah" <shah (AT) typhoon (DOT) xnet.com> wrote in message
>> news:bh9v09$cgf$1 (AT) flood (DOT) xnet.com...
>> >
>> > Folks,
>> >
>> > Does DB2 support multiple charsets?
>> >
>> > In Oracle you can set NLS_CHARACTERSET and NLS_NCHAR_CHARACTERSET
>> > and declare a column as CHAR or NCHAR.
>> >
>> > We are planning to migrate our application to use Unicode and would
>like
>> to
>> > use both ASCII and Unicode character at the same time.
>> >
>> >
>> >
>> > --
>> > Hemant Shah /"\ ASCII ribbon campaign
>> > E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
>> > X against HTML mail
>> > TO REPLY, REMOVE NoJunkMail / \ and postings
>> > FROM MY E-MAIL ADDRESS.
>> > -----------------[DO NOT SEND UNSOLICITED BULK
>E-MAIL]------------------
>> > I haven't lost my mind, Above opinions are mine only.
>> > it's backed up on tape somewhere. Others can have their own.
>>
>>
>>
>> --
>> Hemant Shah /"\ ASCII ribbon campaign
>> E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
>> X against HTML mail
>> TO REPLY, REMOVE NoJunkMail / \ and postings
>> FROM MY E-MAIL ADDRESS.
>> -----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
>> I haven't lost my mind, Above opinions are mine only.
>> it's backed up on tape somewhere. Others can have their own.
>
>
>
>
>

--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands



--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah (AT) xnet (DOT) com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.

Reply With Quote
  #5  
Old   
Sherman Lau
 
Posts: n/a

Default Re: Support for multiple char sets? - 08-18-2003 , 11:42 AM



The GRAPHIC datatypes may be new in the non-Asia Pacific market. Indeed, we
support Unicode GRAPHIC column in EUC database in DB2 v2, 8 years ago. In a
EUC Japanese/Tradional Chinese database, the CHAR columns are encoded in EUC
and the GRAPHIC columns are encoded in Unicode UCS-2.

Other than UTF-8 and EUC databases, the codeset of the CHAR and GRAPHIC
columns are almost the same.

GRAPHIC column is not support in SBCS databases such as ISO-8859-1.

Sherman
"Anton Versteeg" <anton_versteeg (AT) nnll (DOT) iibbmm.com> wrote

Quote:

Hemant Shah wrote:

While stranded on information super highway Anton Versteeg wrote:
The column names are UTF8 and UCS2 respectively.
No you cannot specify character sets on the create table statement,
other than chosing (var)char for utf8 and (var)graphic for ucs2. You
speciy the codepage when you create the database.

O.K. I think I am begining to understand.

If I declare database code page as UTF-8, then the char, varchar, etc.
will
use UTF-8 character set, and graphics, vargraphics, etc. will use USC2.

Is that correct?

Yes


Is there a document that will tell me the same thing about other code
pages?
e.g. If the DB codepage is ISO8859-1 then what character sets are used
for
char, etc. and graphics, etc.

As far as I know this behaviour is only for utf-8 .


--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands





Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.