w3resource

Oracle NCHR function

Description

The Oracle NCHAR() function is used to get the character having the binary equivalent to the number in the national character set. This function is equivalent to using the CHR function with the USING NCHAR_CS clause.

Uses of Oracle NCHR Function
  • Converting Numbers to Characters: Retrieves characters based on their numeric values in the national character set.

  • Handling Multilingual Data: Supports internationalization by working with national character sets.

  • Generating Special Characters: Produces special characters for formatting or other purposes.

  • Data Encoding: Encodes data into specific characters using their numeric codes.

  • Working with Unicode Characters: Facilitates operations involving Unicode characters.

  • Text Processing and Manipulation: Enhances text processing by converting numeric codes to their corresponding characters.

Syntax:

NCHR(number)

Parameters:

This function takes as an argument a NUMBER value, or any value that can be implicitly converted to NUMBER, and returns a character.

Return Value Type

The value returned is always NVARCHAR2.

Applies to

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Examples: Oracle NCHR function

The following examples return the nchr character against a given number.

SQL> SELECT NCHR(122) FROM DUAL;
N
-
z
SQL> SELECT NCHR(162) FROM DUAL;
N
-
ó
SQL> SELECT NCHR(188) FROM DUAL;
N
-
╝

Previous: LTRIM
Next: NLS_INITCAP



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/oracle/character-functions/oracle-nchr-function.php