NLS_CHARSET_ID

NLS_CHARSET_ID returns the character set ID number corresponding to the character set name.

SQL syntax

NLS_CHARSET_ID(String)

Parameters

NLS_CHARSET_ID has the parameter:

Parameter Description

String

The input string argument is a run-time VARCHAR2 value that represents the character set. This string is case-insensitive.

If the input string corresponds to a supported TimesTen character set, the associated character set ID number is returned; otherwise, NULL is returned.

Providing CHAR_CS returns the database character set ID number. Providing NCHAR_CS returns the national character set ID number. Other input string values are interpreted as Oracle Database NLS character set names, such as AL32UTF8.

Examples

The following example returns the character set ID number of character set US7ASCII:

Command> SELECT nls_charset_id('US7ASCII') FROM dual;
< 1 >
1 row found.

Also see the example in the next section, "NLS_CHARSET_NAME", that uses the NLS_CHARSET_ID result as input to NLS_CHARSET_NAME.