ASCII
ASCII(char)

Returns the decimal representation of a character, based on the character set in effect for the database. A true ASCII value will be returned only if a 7-bit ASCII character set is in use for the database. Notice that the parameter to the ASCII function may be a string as well as a single character. However, if a string is provided, the ASCII function returns a value based on the first character of that string.

Example

SQL> SELECT ASCII('D'), ASCII('Dave') FROM dual;

ASCII('D') ASCII('DAVE')
---------- -------------
        68            68

Get Oracle SQL: the Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.