QUOTE_LITERAL

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns a string suitably quoted to be used as an SQL string literal.

Syntax 

1quote_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.

1SELECT quote_literal(E'O\'Reilly') AS result;

Returns '''O''''Reilly'''.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!