CHR()
All functions > STRING > CHR()
Returns the character corresponding to the given Unicode code point.
Signatures
Returns: The character corresponding to the code point
CHR(code_point: BIGINT) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
code_point | BIGINT | Yes | A BIGINT representing the Unicode code point |
Notes
- Valid code points range from 0 to 1114111 (0x10FFFF)
- Returns NULL if the input is NULL (in FeatureQL use
NULL(BIGINT); bareNULLis untyped and fails inference) - Invalid code points are rejected with an error
- This is the inverse operation of CODEPOINT
Examples
FeatureQL
SELECT
-- ASCII character 'A'
f1 := CHR(65),
-- ASCII character 'a'
f2 := CHR(97),
-- ASCII character '0'
f3 := CHR(48),
-- Euro symbol
f4 := CHR(8364),
-- Emoji character
f5 := CHR(128512),
-- NULL code point yields NULL
f6 := CHR(NULL(BIGINT))
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR | f5 VARCHAR | f6 VARCHAR |
|---|---|---|---|---|---|
| A | a | 0 | € | 😀 | NULL |
On this page