ASCII
functionsupportedCore SQL functionsReturns the ASCII code for the first character of a string. If the string is empty, a value of 0 is returned. See also: CHAR , UNICODE
Syntax
ASCII( <input> )
Parameters
| Name | Required | Description |
|---|---|---|
input | required | The string for which the ASCII code for the first character in the string is returned. |
Returns
The value is an integer that is the numeric representation of the ASCII character. For example, if the input is the letter ‘a’, then the return value is 97.
Usage notes
- The value 0 is returned for either of the following cases:
- The first character of the string contains the ASCII character corresponding to 0.
- The string is empty.
- To distinguish between these two cases, use the LENGTH function to determine whether the string is empty.