Solved

How to fetch codepage of a UNICODE database

Posted on 2004-10-12
8
914 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 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