NCHR
NCHAR( integer_expression )
Section titled “NCHAR( integer_expression )”- integer_expression: This parameter specifies the length for the NCHAR data type. Its value must be a valid integer from 1 through 4,000. The integer_expression references the number of Unicode characters that the NCHAR function will hold. This number does not vary according to the national character set.
Example
Section titled “Example”SELECT NCHAR(9731) AS Snowflake_Icon;Output
Section titled “Output”Snowflake_Icon☃Explanation
Section titled “Explanation”This script uses the NCHAR function to convert the numeric value (9731) to a unicode character (☃) in SQL Server.
NCHR(character_set, number_expression)
Section titled “NCHR(character_set, number_expression)”- character_set: This parameter specifies the character set for the output result. It is an ID that represents a particular set of characters. These sets can range widely in size and complexity, from basic ASCII characters to complex special symbols in various dialects.
- number_expression: This parameter denotes the Unicode code point of the character to be returned. In simpler terms, it’s a numerical expression that stands for a specific character in Unicode. For example, the Unicode code point for ‘A’ is 65. If 65 is used as the number expression, NCHR will return the character ‘A’.
Example
Section titled “Example”SELECT NCHR(100) FROM dual;Output
Section titled “Output”d-dExplanation
Section titled “Explanation”The NCHR function in Oracle SQL returns the Unicode character based on the numeric value provided. In the given example, NCHR(100) returns the Unicode character corresponding to the number 100 which is ‘d’.