charan_leo
asked on
How to fetch codepage of a UNICODE database
hi,
if i have to retrieve the codepage charset of the Sybase
what SQL query will fetch me the result for that
NE ONE!!!!!!!!!!
if i have to retrieve the codepage charset of the Sybase
what SQL query will fetch me the result for that
NE ONE!!!!!!!!!!
ASKER
hi
thanx for the info
i want to know two things y r we hard coding c.config =131
and what if i want the encoding of client and database as well
thanx for the info
i want to know two things y r we hard coding c.config =131
and what if i want the encoding of client and database as well
If you don't want to hardcode config = 131 use:
select sc.name
from syscharsets sc, sysconfigures c
where c.comment = "default character set id"
and c.value = sc.id
AFAIK database doesn't have it's own charset - default charset is just one for whole server.
AFAIK server doesn't know, what charset is client using - conversion is done on client's side. So, you can't get charset of client via SQL. Charset on client is usually defined in locales.dat file ( $SYBASE/locales/locales.da t )
select sc.name
from syscharsets sc, sysconfigures c
where c.comment = "default character set id"
and c.value = sc.id
AFAIK database doesn't have it's own charset - default charset is just one for whole server.
AFAIK server doesn't know, what charset is client using - conversion is done on client's side. So, you can't get charset of client via SQL. Charset on client is usually defined in locales.dat file ( $SYBASE/locales/locales.da
ASKER
Hi
I am using C technology to retrieve data stored in Sybase database using CT library functions
if I set the LC_CTYPE envoironment variable at the client end as per the database charset retrieved from the above query
will that still need conversion of data ???
basically i want to know
if i have to compare and check that whether database encoding and client encoding are set different
which envorinment variable should i choose
I am using C technology to retrieve data stored in Sybase database using CT library functions
if I set the LC_CTYPE envoironment variable at the client end as per the database charset retrieved from the above query
will that still need conversion of data ???
basically i want to know
if i have to compare and check that whether database encoding and client encoding are set different
which envorinment variable should i choose
Well - I'd recommend you to study Open Client's International Developer's Guide - http://sybooks.sybase.com/onlinebooks/group-cn/cng1251e/i_and_l.
ASKER
hi,
thanx for this knowledge
what i want to know is that when i call cs_loc_alloc it allocates structure CS_LOCALE and copies current localization information into CS_LOCALE structure i want to know that does it copy the client codepage info the structure or the database codepage into the structure
the query you have given me will give me the charset of database and if i have to check the client codepage
how should i go about it ??
thanx for this knowledge
what i want to know is that when i call cs_loc_alloc it allocates structure CS_LOCALE and copies current localization information into CS_LOCALE structure i want to know that does it copy the client codepage info the structure or the database codepage into the structure
the query you have given me will give me the charset of database and if i have to check the client codepage
how should i go about it ??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
select sc.name
from syscharsets sc, sysconfigures c
where c.config=131
and c.value = sc.id