And avoid python's string formating. Use paramterized queries.
cursor.execute(
"SELECT mrc_code from blocks where mrc_code in (%s, %s, %s, %s)",
blkfld)
You can generate that string too, instead of hard coding it:
sqlQuery = "SELECT mrc_code FROM blocks WHERE mrc_code in (%s)" %
(",").join(["%s" for x in blkfld])
cursor.execute(sqlQuery, blkfld)
On Wed, 2006-10-25 at 10:01 +0000, William Dode wrote:
> On 25-10-2006, Janice Sterling wrote:
>
> select mrc_code from blocks where mrc_code in ('31103a1', '31103e1',
> '31103a5', '31103e5')
>
> isnt'it ?
>
_______________________________________________
DB-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/db-sig