background image
<< Establishing a Globalization Support | Setting Language and Territory Parameters >>
<< Establishing a Globalization Support | Setting Language and Territory Parameters >>

Choosing a Locale with the NLS_LANG Parameter

Establishing a Globalization Support Environment
6-8 Oracle Database 2 Day Developer's Guide
Choosing a Locale with the NLS_LANG Parameter
A locale is a linguistic and cultural environment in which a system or program is
running. Setting the
NLS_LANG
parameter is the simplest way to specify locale
behavior for Oracle software. It sets the language and territory used by the client
application and the database. It also sets the client character set, which is the character
set for data entered or displayed by a client program.
The
NLS_LANG
parameter sets the language and territory environment used by both
the server session (for example, SQL statement processing) and the client application
(for example, display formatting in Oracle tools).
While the default
NLS_LANG
behavior defined during installation is appropriate for
most situations, you might want to modify the NLS environment dynamically during
the session. To do so, you can use the
ALTER
SESSION
statement to change
NLS_
LANGUAGE
,
NLS_TERRITORY
, and other NLS parameters.
Note that you cannot modify the setting for the client character set with the
ALTER
SESSION
statement. The
ALTER SESSION
statement modifies only the session
environment. The local client NLS environment is not modified, unless the client
explicitly retrieves the new settings and modifies its local environment.
Setting NLS Parameters
National Language Support (NLS) parameters determine the locale-specific behavior
on both the client and the server. NLS parameters can be specified several ways. You
can alter parameters for the user session and override the parameters in SQL
functions.
You can alter the NLS parameters settings in the following two ways:
Set NLS parameters in an
ALTER SESSION
statement to override the default
values that are set for the session in the initialization parameter file, or that are set
by the client with environment variables. For example:
ALTER SESSION SET NLS_SORT = french;
Note that the changes that you make with the
ALTER SESSION
statement apply
only to the current user session and are not present the next time you log in.
Use NLS parameters within a SQL function to 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','nls2008language = FRENCH')
Additional methods for setting the NLS parameters include the use of NLS
environment variables on the client, which may be platform-dependent, to specify
See Also:
Oracle Database Globalization Support Guide for a complete
discussion of globalization support with Oracle Database,
including setting up the globalization support environment
See Also:
Oracle Database Globalization Support Guide for a complete
discussion of globalization support with Oracle Database,
including setting up the globalization support environment