All Products
Search
Document Center

PolarDB:Character set functions

Last Updated:Mar 28, 2024

This topic describes the syntax, parameters, and examples of character set functions.

NLS_CHARSET_NAME

Description

This function returns the name of a character set based on the ID of the character set.

Syntax

NLS_CHARSET_NAME(charset_id)

Parameters

Parameter

Description

charset_id

The ID of the character set. The value is of the INT data type.

Return value

The return value is of the VARHCAR2 data type.

Example

SELECT nls_charset_name(8) FROM DUAL;
 nls_charset_name 
------------------
 LATIN1

NLS_CHARSET_ID

Description

This function returns the ID of a character set based on the name of the character set.

Syntax

NLS_CHARSET_ID(charset_name)

Parameters

Parameter

Description

charset_name

The name of the character set. The value is of the VARCHAR2 data type.

Return value

The return value is of the INT data type.

Example

SELECT nls_charset_id('utf8') FROM DUAL;
 nls_charset_id 
----------------
              6