Re: dbapi2 select where IN (...)

2009-11-30 Thread Duncan Booth
Gerhard Häring wrote: >> execute("""SELECT * FROM table WHERE num IN ?;""" , >> ((2,3,8,9),))...fail... [...] > > You cannot use parameter binding when the number of parameters is > unknown in advance. So you'll have to create this part of the SQL query > differently. > > For example: > >

Re: dbapi2 select where IN (...)

2009-11-30 Thread Gerhard Häring
yota.n...@gmail.com wrote: > hello, > > I couldn't find how the dbapi2 planned to handle the sql IN statement. > > ex : > SELECT * FROM table WHERE num IN (2,3,8,9); > > I'd be glad to take advantage of the ? mechanism, but what about > tuples ! > > execute("""SELECT * FROM table WHERE num IN ?

dbapi2 select where IN (...)

2009-11-30 Thread yota.n...@gmail.com
hello, I couldn't find how the dbapi2 planned to handle the sql IN statement. ex : SELECT * FROM table WHERE num IN (2,3,8,9); I'd be glad to take advantage of the ? mechanism, but what about tuples ! execute("""SELECT * FROM table WHERE num IN ?;""" , ((2,3,8,9),))...fail... what would be