Strings and % sign fails - Help Please

Christoph Zwerschke cito at online.de
Fri Mar 24 08:20:19 CET 2006


Erik Max Francis wrote:
> His problem is that cursor.execute does format expansion with %, so a 
> single % is not legal.

Yes, I think psycopg uses paramstyle='pyformat', i.e. it expands 
parameters in your sql in the usual Python way where % has a special 
meaning. If you really mean the % sign only, use %%.

-- Christoph



More information about the Python-list mailing list