In Oracle/PLSQL, the ascii function returns the NUMBER code that represents the specified character.
Syntax
The syntax for the ascii function is:
ascii( single_character )
single_character is the specified character to retrieve the NUMBER code for. If more than one character is entered, the function will return the value for the first character and ignore all of the characters after the first.
Applies To
- Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
For Example
ascii('t') | would return 116 |
ascii('T') | would return 84 |
ascii('T2') | would also return 84 |
select ascii('y') as asciiChar from dual;