Solved

How to fetch codepage of a UNICODE database

Posted on 2004-10-12
8
919 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Copy a TadoDataSet to another and apply changes to database. 11 1,304
SQL Query 2 354
SSIS - Update a Sybase Table 33 188
SQL select to return the latest row for each vacancyID 17 127
Changing a few Outlook Options can help keep you organized!
Check out this step-by-step guide for asking an anonymous question on Experts Exchange.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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