[DB-SIG] Parameter substitution and "IN" operator

2008-03-17 Thread Eric Brunson
Has there been any discussion of supporting lists or tuples as parameters to the "IN" operator? I'd like to be able to do something to the effect of: curs.execute( "select * from mytable where col1 = %s and col2 in (%s)", ( 'firstval', ('list', 'of', 'vals') ) Or perhaps: curs.e

Re: [DB-SIG] Parameter substitution and "IN" operator

2008-03-17 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Eric Brunson wrote: > Has there been any discussion of supporting lists or tuples as > parameters to the "IN" operator? [...] I didn't search the archives, either ;-) > I'd like to be able to do something to the effect of: > > curs.execute( "select

Re: [DB-SIG] Parameter substitution and "IN" operator

2008-03-17 Thread Alex Willmer
On Tue, 2008-03-18 at 00:14 +0100, Gerhard Häring wrote: > This is not the way SQL parameter binding works. SQL parameter binding > only works with scalars (*). If tuples seem to work, then that's just > a side-effect of the implementation of your particular DB-API module. >>From here, it seems li

Re: [DB-SIG] Parameter substitution and "IN" operator

2008-03-17 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alex Willmer wrote: > On Tue, 2008-03-18 at 00:14 +0100, Gerhard Häring wrote: >> This is not the way SQL parameter binding works. SQL parameter binding >> only works with scalars (*). If tuples seem to work, then that's just >> a side-effect of the im