background image
<< Setting the NLS_COMP Parameter | Setting the NLS_LENGTH_SEMANTICS Parameter >>
<< Setting the NLS_COMP Parameter | Setting the NLS_LENGTH_SEMANTICS Parameter >>

Using Length Semantics

Establishing a Globalization Support Environment
Working in a Global Environment 6-25
6.
Set
NLS_COMP
back to its original setting listed in Step 1. For example:
ALTER SESSION SET NLS_COMP=BINARY;
Using Case-Insensitive and Accent-Insensitive Search
Operations inside a database are sensitive to the case and the accents of the characters.
Sometimes, you might need to perform case-insensitive or accent-insensitive
comparisons. Use the
NLS_SORT
session parameter to specify a case-insensitive or
accent-insensitive sort.
To specify a case-insensitive or accent-insensitive sort:
Append
_CI
to an Oracle sort name for a case-insensitive sort. For example:
BINARY_CI
: accent-sensitive and case-insensitive binary sort
GENERIC_M_CI
: accent-sensitive and case-insensitive
GENERIC_M
sort
Append
_AI
to an Oracle sort name for an accent-insensitive and case-insensitive
sort. For example:
BINARY_AI
: accent-insensitive and case-insensitive binary sort
FRENCH_M_AI
: accent-insensitive and case-insensitive
FRENCH_M
sort
Using Length Semantics
In single-byte character sets, the number of bytes and the number of characters in a
string are the same. In multibyte character sets, a character or code point consists of
one or more bytes. Calculating the number of characters based on byte length can be
difficult in a variable-width character set. Calculating column length in bytes is called
byte semantics, while measuring column length in characters is called character
semantics.
Character semantics is useful to define the storage requirements for multibyte strings
of varying widths. For example, in a Unicode database (AL32UTF8), suppose that you
need to define a
VARCHAR2
column that can store up to five Chinese characters
together with five English characters. Using byte semantics, this column requires 15
bytes for the Chinese characters, which are 3 bytes long, and 5 bytes for the English
See Also:
Oracle Database Reference for more information on the
NLS_COMP
parameter.
Using the NLS_SORT Parameter
on page 6-22
Using Case-Insensitive and Accent-Insensitive Search
on
page 6-25
Oracle Database Globalization Support Guide for a complete
discussion of linguistic sort and string searching
See Also:
Oracle Database Reference for more information on the
NLS_SORT
parameter.
Using the NLS_SORT Parameter
on page 6-22
Using the NLS_COMP Parameter
on page 6-23
Oracle Database Globalization Support Guide for a complete
discussion of linguistic sort and string searching