QUOTE_LITERAL

Returns the given string, suitably quoted, to be used as a string literal in a SQL statement string. Embedded single quotes and backslashes are doubled.

Behavior Type

Immutable

Syntax

QUOTE_LITERAL ( string )

Parameters

string

String to convert to a string literal.

Notes

Vertica recognizes two consecutive single quotes within a string literal as one single quote character. For example, 'You''re here!'. This is the SQL standard representation and is preferred over the form, 'You\'re here!', as backslashes are not parsed as before.

Examples

=> SELECT QUOTE_LITERAL('You''re here!');
  QUOTE_LITERAL
-----------------
 'You''re here!'
(1 row)