Oracle PL/SQL String / Character Functions - ASCII Function

ASCII Function : 

Syntax : ASCII ('input_character')

  • In Oracle PL/SQL ASCII function returns the numeric value associated with a character.
  • Return Type of ASCII function is NUMBER.
  • This Function doesn't support CLOB datatype as input
  • Input_character should be of one character. If the input character has more than one letter, than the function takes the first character of the string.

In the below example the first result returns  the numeric equivalent of the character 'a'. In the second example, since more that one character is entered it has returned the ASCII value of the first character which is 'd'.

Example: 

ASCII('a')
Result: 97
ASCII('developersarena')
Result: 100