Locale database parameter
Description
Specifies the locale name that you want the Sybase Open Client
software to use when connecting to an SAP Adaptive Server Enterprise
database or a database accessed through DirectConnect in PowerBuilder.

You must specify the Locale parameter before connecting
to the database.
Controls
-
ASE, SYC SAP Adaptive
Server Enterprise -
DIR Sybase DirectConnect
Syntax
1 |
Locale='<span>locale_name</span>' |
Default
The default locale defined in your LOCALES.DAT file
Usage
Locales
Locales are stored as entries in a file named LOCALES.DAT.
The LOCALES.DAT file contains information about
the languages and character sets you are using with the Sybase Open
Client software. The Sybase Open Client installation places the LOCALES.DAT file
in the $SYBASELOCALES directory.
An entry in the LOCALES.DAT file has
the following format:
1 |
locale=<span>locale_name</span>, <span>language_name</span>, <span>character_set_name</span> |
For example:
1 |
locale=default, us_english, cp850 |
1 |
locale=enu, us_english, cp850 |
1 |
locale=fra, french, cp850 |
Why set Locale parameter
Setting a value for the Locale parameter lets you use a locale other
than the default locale when accessing an Adaptive Server Enterprise
or DirectConnect database. If you do not set a value for Locale, Sybase
Open Client uses the default locale defined in your LOCALES.DAT file.
What happens
When you specify a value for the Locale parameter, PowerBuilder:
-
Allocates a CS_LOCALE
structure for this connection -
Sets the CS_LC_ALL value to the
locale name you specify -
Sets the SQL Server
CS_LOC_PROP connection property with the new locale
information
Overriding Locale parameter
If you have previously set a value for the Locale parameter
that includes settings for the language and character set you want
to use, you can override the language or character set values by
specifying new values for the Language or CharSet parameter and
reconnecting to the database.
Unicode data access
The DataWindow server can
access Unicode data in an ASE 12.5 or later Unicode database or
in Unicode columns in ASE 12.5 or later. The DataWindow server converts between
double-byte character set (DBCS) data and Unicode automatically,
provided that the Locale parameter is set with DBCS values. For
example, the Locale parameter should be set to chs or cht.
Examples
To set the locale to fra:
-
Database profile
Type the following in the Locale box on the Regional Settings
page in the Database Profile Setup dialog box:1fra -
Application
Type the following in code:
1SQLCA.DbParameter="Locale='fra'"
Setting the Locale parameter to fra has
the same effect as individually setting both the Language and CharSet
parameters as follows:
1 |
Language='French' |
1 |
CharSet='cp850' |