background image
<< Using NLS Parameter Values | Changing NLS Parameter Values for All Sessions >>
<< Using NLS Parameter Values | Changing NLS Parameter Values for All Sessions >>

Reviewing NLS Parameter Values

Using NLS Parameter Values in the SQL Developer Environment
Working in a Global Environment 6-5
ALTER SESSION SET
parameter-name
= "
value"
;
When you are using SQL Developer, be aware that the parameter values from the
database initialization file are not used. Instead, SQL Developer initially (after
installation) uses parameter values that include the following:
NLS_LANG,"AMERICAN"
NLS_TERR,"AMERICA"
NLS_CHAR,"AL32UTF8"
NLS_SORT,"BINARY"
NLS_CAL,"GREGORIAN"
NLS2008LANG,"AMERICAN"
NLS2008FORM,"DD-MON-RR"
These and other NLS parameter values, which are used for all sessions in SQL
Developer (such as SQL Worksheet windows and the National Language Support
Parameters report, for all connections), are visible in the Database: NLS Parameters
preferences pane.
To change the value of any NLS parameter, you have the following options:
Change the value for use with all SQL Developer connections (current and future)
by using the Database: NLS Parameters preferences pane, as explained in
"Changing NLS Parameter Values for All Sessions"
on page 6-6.
Change the value for the current connection only by using the
ALTER SESSION
statement in the SQL Worksheet window.
Thus, you have great flexibility in testing different language settings during database
application development. For example, you can use
ALTER SESSION
to see the
output of subsequent PL/SQL statements with different language settings, and then
revert to the SQL Developer default settings by disconnecting and reconnecting.
For example, assume that the
NLS_LANGUAGE
value in the preferences is set to
FRENCH
, and that today is March 1, 2007. If you enter
SELECT sysdate FROM
dual;
in the SQL Worksheet and click the Run Script icon, the output is:
SYSDATE
-------------------------
01-MARS -07
If you enter
ALTER SESSION SET NLS_LANGUAGE='AMERICAN';
and enter the
preceding
SELECT
statement again, the output is:
SYSDATE
-------------------------
01-MAR-07
Continuing with this example, if you disconnect from the current connection and
reconnect to it, the session
NLS_LANGUAGE
value is
FRENCH
(as specified in the
preferences), and the
SELECT
statement output is:
SYSDATE
-------------------------
01-MARS -07