CODEPOINT

All functions > STRING > CODEPOINT

Returns the Unicode code point of the first character in a string.

Syntax

CODEPOINT(expr)
sql

Arguments

ParameterTypeRequiredDescription
stringVARCHARYesA 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

Examples

Last update at: 2025/12/05 16:03:14
Last updated: 2025-12-05 16:07:55