Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

PLSQL | NCHR Function

  • Last Updated : 25 Sep, 2019

The PLSQL NCHR function is used for returning the character based on the number code in the national character set or in other words it returns the binary equivalent to the number in the national character set. The value returned by the NCHR function is always of the datatype NVARCHAR2.

The NCHR function is equivalent to using the CHR function with the USING NCHAR_CS clause. The parameter passed to the NCHR function takes a NUMBER as an argument, or any value that can be implicitly converted to NUMBER, and returns a character.

Attention reader! Don’t stop learning now. Learn SQL for interviews using SQL Course  by GeeksforGeeks.

Syntax:

NCHR(number_code)

Parameters Used:



number_code – It is used to specify the NUMBER code in the national character set used to retrieve the character.

Supported Versions of Oracle/PLSQL:

  1. Oracle 12c
  2. Oracle 11g
  3. Oracle 10g
  4. Oracle 9i
  5. Oracle 8i

Example-1:

DECLARE 
   Test_value int := 103;
   
BEGIN 
   dbms_output.put_line(NCHR(Test_value)); 
   
END;   

Output:

g 



Example-2:

DECLARE 
   Test_value int := 103;
   
BEGIN 
   dbms_output.put_line(CHR(Test_value USING NCHAR_CS)); 
   
END;      

Output

g



Example-3:

DECLARE 
   Test_value int := 187;
   
BEGIN 
   dbms_output.put_line(NCHR(Test_value)); 
   
END;    

Output:

ยป 
My Personal Notes arrow_drop_up
Recommended Articles
Page :