background image
<< Using the NLS_TERRITORY Parameter | Setting Dates and Time Parameters >>
<< Using the NLS_TERRITORY Parameter | Setting Dates and Time Parameters >>

Setting the NLS_TERRITORY parameter

Establishing a Globalization Support Environment
Working in a Global Environment 6-11
ISO currency symbol
Dual currency symbol
Modifying the
NLS_TERRITORY
parameter resets all derived NLS session parameters
to default values for the new territory.
To set the NLS_TERRITORY parameter:
You can change the
NLS_LANGUAGE
parameter value and see the effect in the display
of results from a query. The following examples show the effect of setting
NLS_
TERRITORY
to Germany.
1.
In SQL Developer, enter a
SELECT
statement to check the format of the output
with the initial SQL Developer default settings.
SELECT TO_CHAR(salary,'L99G999D99') salary FROM employees
WHERE employee_id IN (100, 101, 102);
For example, if
NLS_TERRITORY
is
AMERICA
, the output from the example is
similar to the following.
SALARY
--------------------
$24,000.00
$17,000.00
$17,000.00
3 rows selected
2.
Make a note of the current territory in which Oracle Database was installed.
Under Connections, expand Data Dictionary reports, then About Your Database,
and then National Language Support Parameters. In the Select Connection dialog
box, select
hr_conn
from the list of connections. The current territory is listed
after
NLS_TERRITORY
.
3.
Set
NLS_TERRITORY
to Germany.
ALTER SESSION SET NLS_TERRITORY=GERMANY;
4.
Enter the same
SELECT
statement to check the format of the output after the
change.
SELECT TO_CHAR(salary,'L99G999D99') salary FROM employees
WHERE employee_id IN (100, 101, 102);
The output from the example should be similar to the following. The thousands
separator changed to a period (.) and the decimal character changed to a comma
(,). The currency symbol changed from dollars (
$
) to euros (
). However, the
numbers have not changed because the underlying data is the same. (That is,
currency exchange rates are not factored in.)
SALARY
--------------------
24.000,00
17.000,00
17.000,00
3 rows selected
5.
Set
NLS_TERRITORY
back to its original setting listed in Step 2. For example: