QUOTE()
QUOTE(str
)
Returns a quoted string that can be used as a properly escaped
value in a SQL statement. The returned string is enclosed in single
quotes with all instances of single quotes, backslashes, the ASCII
NUL
character, and Ctrl-Z preceded
by a backslash. If the argument str
is
NULL
, the return value is the word
NULL without enclosing quotes. The example code returns the following
string:
'I\'m hungry'
Note how the '
symbol has
been replaced with \'
.
SELECT QUOTE("I'm hungry");