SQL CHR Function
SQL CHR function is exact opposite of ASCII function. The CHR function is used to return the character represented by ASCII value in a string. An error will be returned when a value for the string argument is not specified. The most common use of SQL CHR function is to insert new line in an output. CHR(13) is used to insert new line. The syntax is
CHR (ASCII VALUE)
Example 1:
The following SQL CHR query returns capital ‘A’, the character represented by ASCII value 65.
SELECT CHR(65) FROM dual;
Output:
Example 2:
The following SQL CHR query returns small ‘a’, the character represented by ASCII value 97.
SELECT CHR(97) FROM dual;
Output: