NLS Parameter Values in the SQL Developer Environment

In an Oracle database, NLS parameter values are initially determined by database initialization parameters. The DBA can set values in the initialization file, and any changes to that file will take effect at the next database startup. Database users can change specific parameter values for the current session (the current connection to the database) by using a statement in the form: ALTER SESSION SET parameter-name = 'value';

When you are using SQL Developer, be aware that the parameters 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"
NLS_DATE_LANG,"AMERICAN"
NLS_DATE_FORM,"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:

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