Solved

How to fetch codepage of a UNICODE database

Posted on 2004-10-12
8
912 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sybase license issue 6 534
installing Sybase IQ express edition 15.4 16 878
SSIS - Update a Sybase Table 33 157
remote logins for proxy table in sybase 5 43
Troubleshooting common task sequence error codes
For months I had no idea how to 'discover' the IP address of the other end of a link (without asking someone who knows), and it drove me batty. Think about it. You can't use Cisco Discovery Protocol (CDP) because it's not implemented on the ASAs.…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

10 Experts available now in Live!

Get 1:1 Help Now