Locale
database parameter
Description
Specifies the locale name that you want the SAP Sybase Open Client
software to use when connecting to an SAP Adaptive Server Enterprise
database or a database accessed through DirectConnect in
PowerBuilder.
When to specify Locale
You must specify the Locale parameter before connecting to the
database.
Applies to
ASE, SYC SAP Adaptive Server Enterprise
DIR SAP DirectConnect
Syntax
|
1 |
Locale='locale_name' |
Default value
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 SAP Sybase Open Client software. The SAP
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=locale_name, language_name, character_set_name |
For example:
|
1 2 3 |
locale=default, us_english, cp850 locale=enu, us_english, cp850 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, SAP 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
PowerBuilder can access Unicode data in an ASE 12.5 or later
Unicode database or in Unicode columns in ASE 12.5 or later.
PowerBuilder 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.DBParm="Locale='fra'"
What happens
Setting the Locale parameter to fra has the same effect as
individually setting both the Language and CharSet parameters as
follows:
|
1 2 |
Language='French' CharSet='cp850' |
See also