On 01/22/2012 01:49 PM, alex bodnaru wrote:
> hello friends,
>
> i'm using sa at a quite low level, with session.execute(text, dict)
>
> is it possible to do something in the spirit of:
>
> session.execute("select * from tablename where id in (:ids)", 
> dict(ids=[1,2,3,4])) ?
>
> thanks in advance,
> alex
>

I'm not aware of a general way to do this. If you are using
PostgreSQL+psycopg2, you can use the = ANY(...) operator instead of the
IN operator:

session.execute("select * from tablename where id = ANY (:ids)", 
dict(ids=[1,2,3,4]))

-Conor

-- 
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.

Reply via email to