QuoteSQL
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Thu Sep 28 19:54:53 EDT 2006
In message <efeqpd$8vh$1 at lust.ihug.co.nz>, LI wrote:
>>>> execfile("QuoteSQL.py")
>>>> EscapeSQLWild(r"\%")
> '\\\\%'
>>>> SQLString("%" + EscapeSQLWild(r"\%") + "%")
> '"%\\\\\\\\%%"'
>>>> EscapeSQLWild(r"\%") == r"\\%"
> True
>>>> SQLString("%" + EscapeSQLWild(r"\%") + "%") == r'"%\\\\%%"'
> True
With the correction to EscapeSQLWild, this becomes:
>>> execfile("QuoteSQL.py")
>>> EscapeSQLWild(r"\%")
'\\\\\\%'
>>> SQLString("%" + EscapeSQLWild(r"\%") + "%")
'"%\\\\\\\\\\\\%%"'
>>> EscapeSQLWild(r"\%") == r"\\\%"
True
>>> SQLString("%" + EscapeSQLWild(r"\%") + "%") == r'"%\\\\\\%%"'
True
More information about the Python-list
mailing list