cancel
Showing results for 
Search instead for 
Did you mean: 

How can i determine the character set used by a client application (from Sybase ASE)?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member182090
Active Participant
0 Kudos

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).

Former Member
0 Kudos

Thank you very, very much Rob!

Best regards!

Answers (1)

Answers (1)

former_member188958
Active Contributor
0 Kudos

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

former_member182090
Active Participant
0 Kudos

Sure - but I wanted to avoid the undocumented route, and the risks attached to using dbcc pss().

Former Member
0 Kudos

Thanks a lot, Bret!

Best regards!

Former Member
0 Kudos

Thanks, again, Rob!

Would you please tell me where I can find the risks attached to using dbcc pss().

Kind regards!

former_member182090
Active Participant
0 Kudos

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.

Former Member
0 Kudos

Ok Rob, thank you so much!