SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite QUOTE() Function



The SQLite QUOTE() function returns the text of an SQL literal which is the value of its argument suitable for inclusion into an SQL statement. Strings are surrounded by single-quotes with escapes on interior quotes as needed. BLOBs are encoded as hexadecimal literals. Strings with embedded NUL characters cannot be represented as string literals in SQL and hence the returned string literal is truncated prior to the first NUL.

Syntax

QUOTE(X)

Parameters

X Required. Specify a string or blob to be converted into SQL literal suitable for inclusion into an SQL statement.

Return Value

Returns a string suitable for inclusion into an SQL statement.

Example 1:

The example below shows the usage of QUOTE() function.

SELECT QUOTE('Don''t!');
Result: 'Don''t!'

SELECT QUOTE('Don''t! Do it');
Result: 'Don''t! Do it'

❮ SQLite Functions