Re: String formatting - mysql insert

2011-07-14 Thread Christian
On 14 Jul., 17:31, Billy Mays wrote: > On 07/14/2011 11:00 AM, Christian wrote: > > > > > > > > > > > Hi, > > > I get some problem  when i like to set the table name dynamic. > > I'm appreciate for any help. > > > Christian > > > ### works > > newcur.execute (  """ INSERT INTO events (id1,id2

Re: String formatting - mysql insert

2011-07-14 Thread Billy Mays
On 07/14/2011 11:00 AM, Christian wrote: Hi, I get some problem when i like to set the table name dynamic. I'm appreciate for any help. Christian ### works newcur.execute ( """ INSERT INTO events (id1,id2) VALUES (%s,%s); """ , (rs[1],rs[2])) ### works not newcur.execute ( """ INSE

Re: String formatting - mysql insert

2011-07-14 Thread Chris Angelico
On Fri, Jul 15, 2011 at 1:00 AM, Christian wrote: > Hi, > > I get some problem  when i like to set the table name dynamic. > I'm appreciate for any help. > > ### works but is not really perfect: None from rs list result in > "None" instead of NULL. > newcur.execute (  """ INSERT INTO %s_events (id

String formatting - mysql insert

2011-07-14 Thread Christian
Hi, I get some problem when i like to set the table name dynamic. I'm appreciate for any help. Christian ### works newcur.execute ( """ INSERT INTO events (id1,id2) VALUES (%s,%s); """ , (rs[1],rs[2])) ### works not newcur.execute ( """ INSERT INTO %s_events (id1,id2) VALUES (%s,