Oracle ASCII function
Description
The ASCII() function returns the decimal representation of the first character of a character expression.
Character expression can be the following data types:
- CHAR
- VARCHAR2
- NCHAR
- NVARCHAR2
The function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.
Note : If your database character set is 7-bit ASCII, then this function returns an ASCII value. If your database character set is EBCDIC Code, then this function returns an EBCDIC value.
Syntax:
ASCII(character_expression)
Parameters:
Name | Description |
---|---|
character_expression | Is an expression of the above data types mentioned in the list. |
Return Value Type:
NUMBER.
Applies to:
Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
Examples: Oracle ASCII function
The following example returns employees whose first names begin with the letter 'C', whose ASCII equivalent is 67:
SQL> SELECT first_name FROM employees
2 WHERE ASCII(SUBSTR(first_name, 1, 1)) = 67
3 ORDER BY last_name;
Sample Output:
FIRST_NAME -------------- Curtis Charles Christopher Clara
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises