# QUOTE

> QUOTE function in StackQL: the SQL literal text of a value, with strings single-quoted and embedded quotes doubled.

Source: https://stackql.io/language-spec/functions/string/quote

Returns the text of a value as a SQL literal: strings are enclosed in single quotes with embedded single quotes doubled, numbers are returned as they are, and `NULL` is returned as the word `NULL`.

See also:  
[[` SELECT `]](/language-spec/select) [[` JSON_QUOTE `]](/language-spec/functions/json/json_quote)

* * * 

## Syntax

```sql
SELECT QUOTE(value) FROM <multipartIdentifier>;
```

## Arguments

__*value*__  
Any value.

## Return Value(s)
Returns a string.

* * *

## Examples

### Quote values as SQL literals

The following query quotes a string containing an apostrophe, a number and `NULL`:

```sql
SELECT QUOTE('it''s') AS s, QUOTE(42) AS n, QUOTE(NULL) AS z;
```

```
|---------|----|------|
|    s    | n  |  z   |
|---------|----|------|
| 'it''s' | 42 | NULL |
|---------|----|------|
```

For more information, see [https://www.sqlite.org/lang_corefunc.html#quote](https://www.sqlite.org/lang_corefunc.html#quote)
