MySqlDb any way to see the query string

News123 news1234 at free.fr
Sat Jul 10 14:22:21 EDT 2010


Hi,

I'm using MYSQLdb


and have following code


db = MySQLdb.connect(**cfg)
c = db.cursor()
qrystr = "insert mytable set id = %s ,  other_field = %s"
c.execute(qrystr, (id_val,other_field_val) )


What I wondered is whether there is any way to print the 'filled in'
query string for debuggin.

The reason I'm askng is, that I'd like to copy paste the 'filled in'
query string
and try it from the command line.

I know I could create it myself, but I had to do all the esaping myself.

Thanks for suggestions


N



More information about the Python-list mailing list