Oracle CHR function
Description
The CHR function is used to return the character having the binary equivalent to n as a VARCHAR2 value in either the database character set or, from the NCHAR_CS.
For single-byte character sets, when n > 256, then returns the binary equivalent of n mod 256.
This function takes a number as an argument a , or any value that can be implicitly converted to NUMBER, and returns a character.
Syntax:
CHR(n [ USING NCHAR_CS ])
Arguments:
Name | Description |
---|---|
n | A number. |
NCHAR_CS | national character set |
Applies to
Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
Pictorial Presentation

Examples: Oracle CHR function
The following example is run on an ASCII-based machine with the database character set.
SELECT CHR(7)||CHR(65)||CHR(84) "Cap"
FROM DUAL;
Sample Output:
Cap --- HAT
The following example assumes that the national character set is UTF16:
SELECT CHR (210 USING NCHAR_CS)
FROM DUAL;
Sample Output:
C - ╥
Previous:
Oracle-character-functions Introduction
Next:
CONCAT
- 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