This topic describes how to use the string function CHR in Realtime Compute.

Syntax

VARCHAR CHR(INT ascii)

Input parameters

Parameter Data type Description

ascii

INT An integer that ranges from 0 to 255. If the input parameter is out of this range, null is returned.

Description

Converts an ASCII code to a character.

Example

  • Test data
    int1 (INT) int2 (INT) int3 (INT)
    255 97 65
  • Test statements
    SELECT CHR(int1) as var1, CHR(int2) as var2, CHR(int3) as var3
    FROM T1;          
  • Test results
    var1 (VARCHAR) var2 (VARCHAR) var3 (VARCHAR)
    ÿ a A