CHR
CHR(N)
Section titled “CHR(N)”- n: This is an integer parameter that represents the Unicode value of the character this function returns. It ranges from 0 to 65535. The CHR(N) function converts the Unicode integer to a character before returning it.
Example
Section titled “Example”SELECT CHR(65) FROM dual;Output
Section titled “Output”AExplanation
Section titled “Explanation”The CHR function in Oracle SQL returns the character based on the ASCII value. In the example, CHR(65) converts the ASCII value 65 to the corresponding character, which is ‘A’.
CHR(integer_code) RETURNS text
Section titled “CHR(integer_code) RETURNS text”- integer_code: This is the numeric Unicode value of the character to return. It represents the Unicode point of the character in decimal format. The function, CHR(integer_code), interprets this value and returns the corresponding character as a text string.
Example
Section titled “Example”SELECT CHR(65) as output;Output
Section titled “Output” output-------- AExplanation
Section titled “Explanation”In this example, the PostgreSQL function CHR is used to display the character that corresponds to the ASCII code ‘65’, which is ‘A’.
CHR(X)
Section titled “CHR(X)”- x: This parameter represents an integer input value for the CHR(X) function. This integer value is the Unicode code point for the character that the function will return.
Example
Section titled “Example”SELECT CHR(65);Output
Section titled “Output”AExplanation
Section titled “Explanation”In SQLite, the CHR() function returns a string which represents the Unicode character that is the numeric value of the provided argument. In this example, CHR(65) returns ‘A’ because the Unicode numeric value of ‘A’ is 65.