NCHR scalar function

The NCHR function returns a Unicode character with the specified UTF-32 Unicode code point.

Read syntax diagramSkip visual syntax diagram NCHR ( integer-expression )

The schema is SYSIBM.

Note: The NCHR function can be specified only in a Unicode database (SQLSTATE 560AA).
integer-expression
An expression that specifies the UTF-32 Unicode code point.
The expression must return a value that is a built-in numeric, CHAR, VARCHAR, GRAPHIC, or VARGRAPHIC data type.
If the value is not of type INTEGER, it is implicitly cast to INTEGER before the function is evaluated.
The integer-expression must be greater than or equal to 0 (SQLSTATE 42815).
The integer-expression must represent a valid UTF-32 Unicode character (SQLSTATE 22021).

Result

The result of the function is a Unicode character with the CHAR data type and a length of 1 CODEUNITS32.

If the argument can be null, the result can be null. If the argument is null, the result is the null value.

Notes

As a syntax alternative, you can specify UNICHR as a synonym for NCHR.

In the following example, the variable GCLEF is assigned the value '𝀀' (UTF-32 Unicode value U&'\+01d11e'= 119070):SET GCLEF=NCHR(119070):

SET GCLEF=NCHR(119070);