[DB-SIG] MySQLdb - syntax question

Patty patriciap.gu at gmail.com
Mon Apr 24 22:37:37 CEST 2006


Hi again,

> query_string = "update mytable set " + ",".join ( [ key + "=%s" for 
> key, value in d_items ] )
> 
> cursor.execute ( query_string, tuple ( [ value for key, value in 
> d_items ] ) )
> 


Thanks for your prompt reply. I kinda got it, but the the part that I forgot to
mention was that the values are not retrieved from the dictionary. What I
retrieve from the dictionary are the column names and the target. The values are
in a separate list, so how would it be in this case? I'm sorry if I sound silly,
but I'm new to this.
Thanks!
Patty
 






More information about the DB-SIG mailing list