Professional Documents
Culture Documents
Objectives
After completing this lesson, you should be able to:
Determine a correct database character set that meets your
business requirements
Obtain globalization support configuration information
Customize language-dependent behavior for the database
and individual sessions
Specify different linguistic sorts for queries
Retrieve data that matches a search string ignoring case or
accent differences
20 - 2
20 - 3
Language support
Territory support
Character set support
Linguistic sorting
Message support
Date and time formats
Numeric formats
Monetary formats
French
data
Japanese
data
20 - 4
20 - 5
Understanding Unicode
AL32UTF8
63
C3 91
74
AL16UTF16
Supplementary
characters
EE AA 9E
F0 9D 84 9E
64
C3 B6
D0 A4
0063
00E1
0074
A89E
D834 DD1E
0064
00F6
0424
20 - 7
NLS_LANG
Oracle Net
Client
20 - 9
Server
Problems to Avoid
Example:
NLS_LANG:
AL32UTF8
Client
Windows English
Code page: WE8MSWIN1252
Oracle Net
Server
Database character set:
AL32UTF8
20 - 10
% export NLS_LANG=SIMPLIFIED
CHINESE_HONG KONG.ZHS16GBK
20 - 11
20 - 12
Can be exchanged
20 - 13
20 - 14
Specifying Language-Dependent
Behavior for the Session
Specify the locale behavior with the NLS_LANG environment
variable:
Language
Territory
Character set
NLS_LANG=FRENCH_CANADA.WE8ISO8859P1
20 - 16
Default Values
NLS_LANGUAGE
NLS_DATE_LANGUAGE
NLS_SORT
AMERICAN
AMERICAN
BINARY
NLS_TERRITORY
NLS_CURRENCY
NLS_DUAL_CURRENCY
NLS_ISO_CURRENCY
NLS_DATE_FORMAT
NLS_NUMERIC_CHARACTERS
NLS_TIMESTAMP_FORMAT
NLS_TIMESTAMP_TZ_FORMAT
AMERICA
$
$
AMERICA
DD-MON-RR
.,
DD-MON-RRHH.MI.SSXFF AM
DD-MON-RRHH.MI.SSXFF AM TZR
20 - 17
SELECT TO_CHAR(hire_date,'DD.Mon.YYYY',
'NLS_DATE_LANGUAGE=FRENCH')
FROM employees
WHERE hire_date > '01-JAN-2000';
20 - 19
20 - 20
20 - 21
NLSSORT function
Defines the sorting method at the query level
20 - 22
Examples:
NLS_SORT = FRENCH_M_AI
NLS_SORT = XGERMAN_CI
20 - 24
WHERE
ORDER BY
START WITH
HAVING
IN/NOT IN
BETWEEN
CASE-WHEN
20 - 25
20 - 26
Customizing Linguistic
Searching and Sorting
You can customize linguistic sorting for:
Ignorable characters
Contracting or expanding characters
Special combination letters or special letters
Expanding characters or special letters
Special uppercase and lowercase letters
Context-sensitive characters
Reverse secondary sorting
Canonical equivalence
20 - 27
Implicit Conversion
Between CLOB and NCLOB
Transparent implicit conversion is supported in:
SQL IN and OUT bind variables for query and DML
20 - 29
20 - 30
20 - 32
Character set
20 - 33
20 - 34
Summary
In this lesson, you should have learned how to:
Determine a correct database character set that meets your
business requirements
Obtain globalization support configuration information
Customize language-dependent behavior for the database
and individual sessions
Specify different linguistic sorts for queries
Retrieve data that matches a search string ignoring case or
accent differences
20 - 35
Practice 20 Overview:
Using Globalization Support
This practice covers the following topics:
Determining the database character set
Setting the NLS_SORT variable
20 - 36