The SQL manual says: Use two consecutive single-quotes to include a single-quote character in a quoted string. It means that if we want to insert a data included single quote, we should use another quote as the escape character, but in the following statement which is in a my ESQL program, why do not I need single quote as escape sequence but I can still execute the program successfully? (From DBMR1702, version: DBMaker 4.1.6)
sprintf(sChnkbn, "'A");

~ 0 min
2016-03-07 09:45

If you use the following statement in ESQL, the single quote is seeing as escape sequence

EXEC SQL insert into 1702(a,b) values(1,'''A');

But your statement sprintf(sChnkbn, "'A");is a C statement, and for the C language the escape sequence is (\) not a single quote (‘). So, in your statement the single quote is seeing as a common character.

Average rating 0 (0 Votes)

You cannot comment on this entry

Tags