Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Returns the ASCII code of the first character of a string. For UTF-8, returns the Unicode code point.
Syntax
ascii(<string>)
Arguments
Required
<string>: The string whose first character code is to be returned.
Returns
Returns an integer representing the ASCII code or Unicode code point of the first character.
Examples
Get ASCII Code
Get the ASCII code of a character.
SELECT ascii('x') AS result;
Returns 120, the ASCII code for 'x'.