ASCII scalar function

The ASCII function returns the ASCII code value of the leftmost character of the argument as an integer.

Read syntax diagramSkip visual syntax diagramASCII(expression)

The schema is SYSFUN.

An expression that returns a built-in character string value. In a Unicode database, the expression can also return a graphic string, in which case it is first converted to a character string before the function is evaluated. The maximum length is:
  • 4000 bytes for a VARCHAR
  • 1,048,576 bytes for a CLOB


The result of the function is always INTEGER.

The result can be null; if the argument is null, the result is the null value.