Re: providing arguements to queries

Gerhard Haering <[email protected]> Fri, 26 Nov 2004 09:39:54 +0100
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
On Fri, Nov 26, 2004 at 02:36:55PM +1000, Timothy Smith wrote:
> is there another way to provide arguements to a query besides tuples? eg.
> cur.excute("Select %s from table", (column))
> becuase tuples cannot grow or shrink this is VERY limiting, i am in a 
> situation right now where i need to select a range of days of week, 
> because the length might change using a tuple is a pain.

The second argument to execute() must be a sequence. You can use tuples, or
lists, for example.

-- Gerhard
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBpuvadIO4ozGCH14RAr96AJ46/TGQelUv61s5/sKhhuiwBUuP5wCfZJxM
TMJ4VI35p6IAuowelkthlb0=
=RBcB
-----END PGP SIGNATURE-----