ASCII(x)

ASCII(x) is a string function that converts a character string x (string specification) with the code attribute ASCII, UNICODE (if this is ASCII data) or BYTE to ASCII data. Only expressions that supply an alphanumeric value are permitted as string specifications.

Result of the Function ASCII(x)

x is of data type CHAR or VARCHAR, the code attribute for x is ASCII, UNICODE or BYTE

ASCII(x) is a character string in ASCII notation

x is a NULL value

NULL value

The ASCII functions are useful when ASCII code is to be used for sorting or comparison purposes.

Output of a sorted result table in ASCII order:

SELECT ASCII(name) FROM...WHERE...ORDER BY 1