Re: providing arguements to queries

"Billy G. Allie" <[email protected]> Mon, 29 Nov 2004 02:45:09 -0500
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.
|
|
| -------------------------------------------------------
| SF email is sponsored by - The IT Product Guide
| Read honest & candid reviews on hundreds of IT Products from real users.
| Discover which products truly live up to the hype. Start reading now.
| http://productguide.itmanagersjournal.com/
| _______________________________________________
| Pypgsql-users mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/pypgsql-users
|
You can just list them in the query command:
	cur.execute(<query string>, arg1, arg2, ...)

You can provide a list or a tupple containing the parameters (Note, when
providing the areguments as a list or tupple, it must be the only
areument after the query striing).

- --
____       | Billy G. Allie    | Domain....: [email protected]
|  /|      | 7436 Hartwell     | MSN.......: [email protected]
|-/-|----- | Dearborn, MI 48126|
|/  |LLIE  | (313) 582-1540    |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBqtOFnmIkMXoVVdURArRgAKDynI56zsqK3kfOtVcB6EELovL6UACdGQP5
54AqNkekj2AUvhocDVA79DY=
=9Syk
-----END PGP SIGNATURE-----


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/