---
schema_version: "1"
id: 23078dea9ea1cbbb9fd76996ca3302908f074ce66b02510e80d95a68ce3654f1
title: QUOTE_LITERAL
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-func/quote-literal.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/quote-literal.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 59d26b8eead4ce1f2cdfe8d1916fc910b504ad4a9e9b59e3beff3031b3fff63e
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `QUOTE_LITERAL`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns a string suitably quoted to be used as an SQL string literal.

## Syntax

```sql
quote_literal(<string>)
```

## Arguments

### Required

- `<string>`: The string to quote.

## Returns

Returns a text value with appropriate quoting for use as a string literal.

## Considerations

- Embedded single quotes and backslashes are properly doubled.
- Returns NULL on NULL input.

## Examples

### Quote Literal

Quote a string with an apostrophe.

```sql
SELECT quote_literal(E'O\'Reilly') AS result;
```

Returns `'''O''''Reilly'''`.

## Related Documentation

- [String Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
