Reputation: 16646
i want to craete a string which contains '
character, but whenever i try it fails.
SET STR_BUFF = 'SELECT * FROM' || VAR_TABLE || ' WHERE NAME LIKE '%abc%';
But the procedure doesn't compile. Does DB2 also has some characters like Java where we represent "
like \"
.
Thanks,
Upvotes: 0
Views: 711
Reputation: 10066
Use two single quotes to escape the quote character
SET STR_BUFF = 'SELECT * FROM' || VAR_TABLE || ' WHERE NAME LIKE ''%abc%'';'
Upvotes: 3