Setting NLS Parameters. Oracle 9i Globalization Support
Werbung
Werbung
Setting NLS Parameters
Setting NLS Parameters
NLS parameters determine the locale-specific behavior on both the client and the server. NLS parameters can be specified in the following ways:
■
As initialization parameters on the server. You can include parameters in the initialization parameter file to specify a default session NLS environment. These settings have no effect on the client side; they control only the server's behavior.
For example:
NLS_TERRITORY = "CZECH REPUBLIC"
■
In addition,
NLS_LENGTH_SEMANTICS
and
NLS_CONV_EXCP
can be set using the
ALTER SYSTEM
statement.
As environment variables on the client. You can use NLS parameters to specify locale-dependent behavior for the client, and also to override the default values set for the session in the initialization parameter file. For example, on a UNIX system:
% setenv NLS_SORT FRENCH
■
As ALTER SESSION parameters. NLS parameters that are set in an
ALTER
SESSION
statement can be used to override the default values that are set for the session in the initialization parameter file or set by the client with environment variables.
ALTER SESSION SET NLS_SORT = FRENCH;
See Also:
Oracle9i SQL Reference for more information about the
ALTER SESSION
statement
■
As SQL function parameters. NLS parameters can be used explicitly to hardcode NLS behavior within a SQL function. Doing so will override the default values that are set for the session in the initialization parameter file, set for the client with environment variables, or set for the session by the
ALTER
SESSION
statement. For example:
TO_CHAR(hiredate, 'DD/MON/YYYY', 'nls_date_language = FRENCH')
The database character set and the national character set are specified in the
CREATE DATABASE
statement.
3-2
Oracle9 i Globalization Support Guide
Setting NLS Parameters
See Also:
Oracle9i SQL Reference for more information about the
CREATE DATABASE
statement
Table 3–1 shows the precedence order when using NLS parameters. Higher priority
settings will override lower priority settings. For example, a default value will have the lowest possible priority, and can be overridden by any other method. Explicitly setting an NLS parameter within a SQL function overrides all other settings — default, initialization parameter, environment variable, and
ALTER SESSION parameters.
3
4
1
2
5
Table 3–1 Parameter Settings and Their Priorities
Highest Priority
Explicitly set in SQL functions
Set by an
ALTER SESSION
Lowest Priority
statement
Set as an environment variable
Specified in the initialization parameter file
Default
Table 3–2 lists the NLS parameters available with the Oracle server.
Table 3–2 NLS Parameters and their Scope
Parameter
Description
Calendar system
SQL, PL/SQL operator comparison
Credit accounting symbol
Local currency symbol
Date format
Language for day and month names
Debit accounting symbol
Default
Gregorian
Binary
NLS_TERRITORY
NLS_TERRITORY
NLS_TERRITORY
NLS_LANGUAGE
NLS_TERRITORY
Scope:
I= INIT.ORA,
E= Environment Variable,
A= Alter Session
I, E, A
I, E, A
-, E, -
I, E, A
I, E, A
I, E, A
-, E, -
Setting Up a Globalization Support Environment
3-3
Herunterladen
Werbung