Solved

How to fetch codepage of a UNICODE database

Posted on 2004-10-12
8
906 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

15 Experts available now in Live!

Get 1:1 Help Now