• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql

syntax and example of ASCII function in oracle sql

Oracle/SQL ASCII Function

November 23, 2012 by techhoneyadmin

Oracle ASCII FunctionOracle ASCII Function is used to get the NUMBER code that represents the character in ASCII. In other words, SQL ASCII Function returns the ASCII number of the character passed to it.


Oracle ASCII Function Syntax

SELECT ASCII (character)
FROM table_name;

In the above Oracle/SQL ASCII Function Syntax:-

  • character is a single character that is passed to the ASCII function.
  • If more than 1 character is passed to the ASCII function then ASCII function will return the ASCII value of the first character and ignore other characters.

Oracle ASCII Function – Using SQL SELECT Statement Example 1

Oracle ASCII Function is used with the SQL SELECT Statement to get the ASCII value of the character passed.

For example, the SQL ASCII Function query below returns the ASCII value of ‘a’.

SELECT ASCII ('a')
FROM dual;

Will return 97


Oracle ASCII Function – Using SQL SELECT Statement Example 2

The below SQL ASCII Function query returns the ASCII value of ‘abc’.

SELECT ASCII ('abc')
FROM dual;

Will also return 97 and ignore the ASCII values of b and c characters.


Oracle ASCII Function – Using SQL SELECT Statement Example 3

The below SQL ASCII Function query returns the ASCII value of ‘A’.

SELECT ASCII ('A')
FROM dual;

Will return 65


Filed Under: function Tagged With: ASCII function in oracle plsql, ASCII function in oracle sql, ASCIIPLSQL, how to use ASCII function in oracle database query, how to use ASCII function in oracle plsql, how to use ASCII function in oracle sql, syntax and example of ASCII function in oracle database query, syntax and example of ASCII function in oracle plsql, syntax and example of ASCII function in oracle sql, using ASCII function in oracle database query, using ASCII function in oracle plsql, using ASCII function in oracle sql

Copyright © 2025 · Parallax Pro on Genesis Framework · WordPress · Log in