NLS Functions

Oracle provides a subset of string functions oriented toward work with the national language character set. These functions (summarized in Table 8-4) handle cases where the underlying character set matters to the results. For example, if you were using an ASCII character set as your database character set and an EBCDIC character set as your national language character set, you would find that the two character sets had different letters associated with the code 65. You can use CHR to translate 65 to the associated character in the database character set, and the NLS function NCHR to translate 65 to a character in the national language character set.

Table 8-4. National language support functions

Name

Description

NCHR

Returns a value from the national language character set.

NLS_INITCAP

Uppercases the first letter of each word (like INITCAP) and allows you to specify a linguistic sorting sequence.

NLS_LOWER

Lowercases a string in accordance with language-specific rules.

NLS_UPPER

Uppercases a string in accordance with language-specific rules.

NLSSORT

Returns a string of bytes that can be used to sort a string in accordance with language-specific rules.

TO_NCHAR

Converts database character set data into its national character set equivalent.

Get Oracle PL/SQL Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.