Solved

How to fetch codepage of a UNICODE database

Posted on 2004-10-12
8
909 Views
Last Modified: 2011-10-03
hi,

if i have to retrieve the codepage charset of the Sybase
what SQL query will fetch me the result for that

NE ONE!!!!!!!!!!
0
Comment
Question by:charan_leo
  • 4
  • 3
8 Comments
 
LVL 14

Expert Comment

by:Jan_Franek
ID: 12286270
If you want to get default character set of server use this:

select sc.name
from syscharsets sc, sysconfigures c
where c.config=131
and c.value = sc.id
0
 

Author Comment

by:charan_leo
ID: 12286384
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
0
 
LVL 14

Expert Comment

by:Jan_Franek
ID: 12286715
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.dat )
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:charan_leo
ID: 12286831
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
0
 
LVL 14

Expert Comment

by:Jan_Franek
ID: 12287240
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.
0
 

Author Comment

by:charan_leo
ID: 12297268
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 ??

0
 
LVL 14

Accepted Solution

by:
Jan_Franek earned 20 total points
ID: 12297345
Well, if I understand it well, you call cs_loc_alloc usually before you connect to server, so there's no way, how could this function get info from server. It means, it has to be info about client, not the database server.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SyBase SQL Query Syntax 11 465
My first ASE 15.7 developer edition installation. 12 2,072
sql anywhere query 5 139
MS SQL 2008 server - system update recommendation 13 102
If your vDisk VHD file gets deleted from the image store accidentally or on purpose, you won't be able to remove the vDisk from the PVS console. There is a known workaround that is solid.
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now