Abandoned <[EMAIL PROTECTED]> writes:
>> Use a different column type for cache2's column, one more appropriate
>> for storing binary characters (perhaps BYTEA for Postgres). Don't
>> forget to also use a bind variable, something like:
>>
>> cursor.execute("INSERT INTO cache2 VALUES (?)", a)
>>
>> Using "INSERT ... ('%s')" % (a) won't work, since the huge binary
>> string in a can contain arbitrary characters, including the single
>> quote.
>
> I tryed:
> cursor.execute("INSERT INTO cache2 VALUES (?)", a)
Why are you ignoring the first sentence: "Use a different column type
for cache2's column, ..."? The use of bind variables in INSERT will
work only *after* you do the rest of the work.
--
http://mail.python.org/mailman/listinfo/python-list