Returns a character string with the first character having an ASCII value equal to the argument expression.

Syntax

CHR ( integer_expression )

Notes

  • The argument to the function must be of type INTEGER, TINYINT, or SMALLINT.
  • The result is of type CHARACTER.
  • If the argument integer_expression evaluates to NULL, the result is NULL.
  • The CHR and CHAR functions are character‑set dependent, and support multi‑byte characters. If integer_expression is a valid character encoding integer value in the current SQL server character set, the function returns the correct character. If it is not a valid character the function returns a NULL value.

Example

This example illustrates the CHR function and the SUBSTR (substring) function:

SELECT *
    FROM  customer
    WHERE SUBSTR (zip, 1, 1) = CHR (53) ;

Compatibility

Progress extension