enfany
enfany

Reputation: 895

Sybase: how to check case-sensitivity

In my Java application, it needs to find out whether the underlying Sybase db is case-sensitive or case-insensitive at server start-up and config the property accordingly, is there any proper ways to do that?

Upvotes: 1

Views: 1719

Answers (2)

Mike Gardner
Mike Gardner

Reputation: 6651

Case sensitivity is indicated by the Character Set & Sort Order of the server.

You can pull the sort order, and character set from master..syscurconfigs

select value from master..syscurconfigs where config = 132  #Gives you Sort Order ID
select value from master..syscurconfigs where config =      #Gives you Character Set ID

Once you have the two values, you can pull the name of the sort order:

select name from master..syscharsets where id = SortOrderID and csid = CharSetID

If the name includes nocase (for English sets), or nocs (non-English sets) then it is case insensitive.

*I know I am missing a value in my second query, but I will fill it in when I get back to my notes tomorrow

Upvotes: 0

Graeme Perrow
Graeme Perrow

Reputation: 57248

If select if 'A' = 'a' then 0 else 1 endif returns 1, then the DB is case sensitive.

Upvotes: 2

Related Questions