on 01-10-2014 8:02 PM
Hi there.
Is there any way of getting, from the server side (Sybase ASE), the character set used by a client application?
I mean, i need to know through any Sybase ASE resource (system table data, global variable, environment variable, etc.) the specific character set used by any client application connected to Sybase ASE.
I've been looking for a while in the online documentation (Sybase ASE, Open Client/Software Developer´s Kit) without success.
Any help will be appreciated so much.
Kind regards.
Franklin
You can get the charset used by the current session via the session-specific global variables @@client_csname or @@client_csid.
You cannot programmatically access this information for other connections than your own, but in case you just want to collect information about all charset used by connecting client applications, you can use a login trigger to capture this information for each session that connects to ASE (and for example insert the details into a table which you can inspect at a later time).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also get the client character set id from the output of DBCC PSS( suid, spid)
[see DBCC pss - Enterprise Information Management - SCN Wiki ]
The field "pclient_csid" contains the id of the client's character set.
Examples:
bret-sun2% isql -Usa -P -Jutf8
1> select @@spid
2> go
------
15
(1 row affected)
1> set switch on 3604
2> go
Switch 3604 ('print_output_to_client') is turned on.
All supplied switches are successfully turned on.
1> dbcc pss(1,15)
2> go | grep csid
plangid=0 pclient_csid=190 pnextcid=1
1> exit
bret-sun2% isql -Usa -P -Jiso_1
1> select @@spid
2> go
------
17
(1 row affected)
1> set switch on 3604
2> go
Switch 3604 ('print_output_to_client') is turned on.
All supplied switches are successfully turned on.
1> dbcc pss(1,17)
2> go | grep csid
plangid=0 pclient_csid=1 pnextcid=1
There is an open feature request CR 700602 to enhance the pssinfo() built-in function to output additional fields, I've added pclient_csid to the list of requested fields.
-bret
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When running dbcc pss in a busy server, you could potentially run into trouble and your session could be aborted by ASE. That said, this risk used to be bigger many years ago than it is today. The official recommendation is to use this reluctantly and preferably not on busy production systems.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.