On Oct 3, 2007, at 2:46 PM, Paul Kippes wrote:
>
> Is there some other way I can execute a query using a list as a
> bound parameter?
>
> res = db.db_con.text('SELECT module_extra_key_name FROM
> module_extra_keys
> WHERE module_id IN :module_ids').execute({'module_ids': [1,2]})
>
> The above is giving me an "You cannot execute SELECT statements in
> executemany()" error.
>
> This is while I'm running 0.3.8.
its not really possible in the way you describe since the IN clause
requires explicit bind parameters spelled out in a list, i.e. IN
(?, ?, ?, ?).
using SQL expression constructs will generate the bind params for
you, i.e.
select([sometable.c.extra_key_name], sometable.module_id.in_(1,
2)).execute()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---