DB2 Version 10.1 for Linux, UNIX, and Windows

ASCII scalar function

Returns the ASCII code value of the leftmost character of the argument as an integer.

Read syntax diagramSkip visual syntax diagram
>>-ASCII--(--expression--)-------------------------------------><

The schema is SYSFUN.

expression
An expression that returns a value of any built-in character string data type. In a Unicode database, if a supplied value is a graphic string data type, it is first converted to a character string before the function is executed. For a VARCHAR, the maximum length is 4 000 bytes, and for a CLOB, the maximum length is 1 048 576 bytes.

The result of the function is always INTEGER.

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