CHR

The CHR function returns the character that has the ASCII code value specified by the argument. If expression is 0, the result is the blank character (X'20').

CHR(expression)
expression
An expression that returns a value of a BIGINT, INTEGER, or SMALLINT data type. The value of the argument should be between 0 and 255; otherwise, the return value is null. The value is interpreted as the code point for a character in ASCII CCSID 367.

The result of the function is CHAR(1). The result can be null; if the argument is null, the result is the null value.

The CCSID of the result is the default SBCS CCSID of the current server.

Examples

  • Return the character corresponding to the ASCII CCSID 367 code point 65.
    SELECT CHR(65)
        FROM SYSIBM.SYSDUMMY1
    Returns the value 'A'.