String contains a quote '

From SQLZOO
Revision as of 11:16, 17 July 2012 by Marek (Talk | contribs) (Created page with "String contains a quote ' <div class='ht'> <div class=params>schema:scott</div> <div> If the data contains a single quote it must be escaped. </div> <source lang=sql class='...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

String contains a quote '

schema:scott

If the data contains a single quote it must be escaped.

DELETE FROM t_q
DROP TABLE t_q;
CREATE TABLE t_q (a VARCHAR(8));
INSERT INTO t_q VALUES ('O''Brian');
SELECT * FROM t_q