Re: mysql insert with tuple

2012-11-22 Thread Christian
Am Mittwoch, 21. November 2012 20:49:14 UTC+1 schrieb Hans Mulder: > On 21/11/12 18:19:15, Christian wrote: > > > Hi , > > > > > > my purpose is a generic insert via tuple , because the number of fields > > and can differ. But I'm stucking . > > > > > > ilist=['hello',None,7,None,None] >

Re: mysql insert with tuple

2012-11-21 Thread Hans Mulder
On 21/11/12 18:19:15, Christian wrote: > Hi , > > my purpose is a generic insert via tuple , because the number of fields and > can differ. But I'm stucking . > > ilist=['hello',None,7,None,None] > > #This version works, but all varchar fields are in extra '' enclosed. > con.execute(""" INSER

Re: mysql insert with tuple

2012-11-21 Thread Chris Rebert
On Wed, Nov 21, 2012 at 9:19 AM, Christian wrote: > Hi , > > my purpose is a generic insert via tuple , because the number of fields and > can differ. But I'm stucking . > > ilist=['hello',None,7,None,None] > > #This version works, but all varchar fields are in extra '' enclosed. > con.execute(

mysql insert with tuple

2012-11-21 Thread Christian
Hi , my purpose is a generic insert via tuple , because the number of fields and can differ. But I'm stucking . ilist=['hello',None,7,None,None] #This version works, but all varchar fields are in extra '' enclosed. con.execute(""" INSERT INTO {} VALUES %r; """.format(table) , (tuple(ilist),))