CHR
CHR converts an integer ASCII code to a character.
Syntax
CHR (integer)
Remarks
| • | CHR can accept string input, as long as the string can be converted to a numeric value. |
| • | The input must be a value between 0 and 255, inclusive. |
| • | If the input is NULL, the output is NULL. |
| • | If the input is less than zero, an exception is thrown. |
| • | If the input is greater than the maximum value of INTEGER (2147483647), an exception is thrown. |
| • | For an ASCII chart, see http://www.techonthenet.com/ascii/chart.php |
The following table lists the input types that you can use in CHR, and their corresponding output types.
|
Data Type of integer |
Output Type |
|
BIGINT, DECIMAL, INTEGER, SMALLINT, STRING, TINYINT |
CHAR(1) |
|
NULL |
NULL |
Example
SELECT DISTINCT CHR (100) FROM /shared/examples/ds_orders/customers