In Oracle, I can write a query like this:
SELECT ...
FROM ...
WHERE id IN (SELECT f_id FROM f ('param'))
to constrain the returned rows to those that have an id in the set
returned by the table function f.

I would like to generate such a query with sqlalchemy like this:
q = session.query (...)....filter (id.in_ (sq))
but I cannot figure out how to define sq.

I've tried something like this:
sq = session.query ('F_ID').from_statement ('SELECT column_value FROM
TABLE (f (:p1))').params(p1 = 'param')
but I get:
TypeError: 'Annotated_TextClause' object is not iterable

Any suggestions?

Thanks.

Rodney

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to