Name
ASCII
Synopsis
The ASCII function returns the NUMBER code that represents the specified character in the database character set. The specification of the ASCII function is:
FUNCTION ASCII (single_character IN VARCHAR2) RETURN NUMBERwhere single_character is the character to be
located in the collating sequence. Even though the function is named
ASCII, it will return the code location in whatever the database
character set is set to, such as EBCDIC Code Page 500 or 7-bit ASCII.
Remember that the collating code for uppercase letters is different
from that for lowercase letters. For example, in the 7-bit ASCII
character set, ASCII (“a”) returns
97. ASCII (“A”) returns 65 because
the uppercase letters come before the lowercase letters in the
sequence.
If you pass more than one character in the parameter to ASCII, it returns the collating code for the first character and ignores the other characters. As a result, the following calls to ASCII all return the same value of 100:
ASCII ('defg')
ASCII ('d')
ASCII ('d_e_f_g')Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access