SQLite char() Function

The SQLite char() function accepts a series of Unicode code point values ​​as parameters and returns a string consisting of the characters corresponding to these parameters in the order of the parameters.

Syntax

Here is the syntax of the SQLite char() function:

char(x1,x2,...,xN)

Parameters

x1,x2,...,xN

Required. x1,x2,...,xN is some integer value that is a Unicode code point value (or ASCII code). You should specify at least one parameter.

Return value

The SQLite char() function returns a string consisting of the characters corresponding to the arguments.

For example, the calculation process of char(65, 66) is as follows:

  1. The corresponding character of ASCII code 65 is A.
  2. The corresponding character of ASCII code 66 is B.
  3. Combine A and B into a string: AB.
  4. char(65, 66) returns AB.

Examples

To return the character corresponding to 65, use the following statement with an SQLite char() function:

SELECT char(65);
char(65)
--------
A

To return the characters corresponding to the ASCII codes 65 and 66, use the following statement with the SQLite char() function:

SELECT char(65, 66);
char(65, 66)
------------
AB

To return the characters corresponding to the ASCII codes 83, 81, and 76, use the following statement with the SQLite char() function:

SELECT char(83, 81, 76);
char(83, 81, 76)
----------------
SQL