1.

How Do I Use A String Literal That Contains An Embedded Single-quote (') Character?

Answer»

The SQL standard SPECIFIES that single-quotes in strings are escaped by putting TWO single quotes in a row. SQL works LIKE the Pascal PROGRAMMING language in this regard.

Example:

INSERT INTO xyz VALUES('5 O''clock');

The SQL standard specifies that single-quotes in strings are escaped by putting two single quotes in a row. SQL works like the Pascal programming language in this regard.

Example:

INSERT INTO xyz VALUES('5 O''clock');



Discussion

No Comment Found