CODEPOINT
All functions > STRING > CODEPOINT
Returns the Unicode code point of the first character in a string.
Syntax
CODEPOINT(expr)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
string | VARCHAR | Yes | A VARCHAR input containing the character to convert |
Returns
The Unicode code point of the first character
Notes
- Only the first character of the input string is considered
- For multi-byte Unicode characters, returns the full Unicode code point
- Returns NULL if the input is NULL
- Returns 0 for empty strings
- This is the inverse operation of CHR