Re: in ARRAY[12, 14, 15, 20]

Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization initd.org
Message-ID <1258474545.3101.3.camel@mila>
Il giorno mar, 17/11/2009 alle 15.42 +0000, Giles Velarde ha scritto:
> I have come accross an odd situation where I am trying to pass pass
> an  
> array of IDs into a query:
> 
> since = "2009-06-01"
> ids = [12, 14, 15, 20] 

If all you want is an "IN" condition then use a tuple, not a list (I
don't remember if you have to import psycopg2.extensions and
psycopg2.extras to get that behaviour, just do both to be safe.)

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
 There's no greys, only white that's got grubby. I'm surprised you
  don't know that. And sin, young man, is when you treat people as
  things. Including yourself.                       -- Granny Weatherwax

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEABECAAYFAksCzDEACgkQvcCgrgZGjevbzgCfcqBc8bQD32ey1aLRcnC1Eo1H
IM0An3Ruu7SpndrDj517mh6JrT3p4FeG
=7Y2P
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.