Reputation: 1207
I'm using sqlalchemy for python ORM , and I want to call a stored procedure which exists in postgresql. I can't find useful tutorials ,please tell me how to code.
Thank you very much
Upvotes: 2
Views: 6775
Reputation: 4570
Using execute()
on Connection
or Engine
object, like:
result = conn.execute('SELECT procname(?,?)', 1, 2).fetchall()
Take a look at SQLAlchemy documentation for more info.
Upvotes: 2
Reputation: 28664
I don't know about any special classes SQLAlchemy provides for calling a procedure.
However you can always use simple select like:
SELECT * FROM proc(4,2);
Upvotes: -1