QuoteSQL

Anders J. Munch 2006 at jmunch.dk
Sun Sep 24 10:31:20 EDT 2006


Lawrence D'Oliveiro wrote:
>>>         elif Ch == "'" or Ch == "\"" or Ch == "\\" :
>>>             Ch = "\\" + Ch
>> Always sad to see an SQL DBMS willfully violate the SQL standard.
> 
> Why is that a violation of SQL?

Taking another look, I might be wrong: Your code uses double quotes, and 
since SQL uses single quotes for string literals, it just might be a 
compatible extension.

Otherwise I would have taken note of the backslash escapes.  E.g. '\\' 
is a two-character SQL string literal.

- Anders



More information about the Python-list mailing list