User's Manual
Presenting Data following User's Locale Convention
Beta Draft Building Global Applications 8-7
EMPID EmpName Salary
---------- --------------------------- ----------
100 S.King 24,000.00
101 N.Kochhar 17,000.00
102 L.De Haan 17,000.00
103 A.Hunold 9,000.00
104 B.Ernst 6,000.00
SQL> alter session set nls_territory=germany;
Session altered.
SQL> select employee_id EmpID,
2 substr(first_name,1,1)||'.'||last_name "EmpName",
3 to_char(salary, '99G999D99') "Salary"
4 from employees
5* where employee_id <105
EMPID EmpName Salary
---------- --------------------------- ----------
100 S.King 24.000,00
101 N.Kochhar 17.000,00
102 L.De Haan 17.000,00
103 A.Hunold 9.000,00
104 B.Ernst 6.000,00
Oracle Linguistic Sorts
Spain traditionally treats ch, ll as well as ñ as letters of their own, ordered after c, l and
n respectively. The examples below, illustrate the effect of using a Spanish sort against
the employee names Chen and Chung.
SQL> alter session set nls_sort=binary;
Session altered.
SQL> select employee_id EmpID,
2 last_name "Last Name"
3 from employees
4 where last_name like 'C%'
5* order by last_name
EMPID Last Name
---------- -------------------------
187 Cabrio
148 Cambrault
154 Cambrault
110 Chen
188 Chung
119 Colmenares
6 rows selected.
SQL> alter session set nls_sort=spanish_m;
Session altered.
SQL> select employee_id EmpID,
2 last_name "Last Name"