Hi,
I'm working with a client that does most of their work in stored procedures
on an oracle database. One of the things I'm trying to help them with is
transitioning to use sqlalchemy for calling said procedures.
For simple input and output types i was able to follow threads in this
group and do something like this:
db.execute(text('begin HELLO_WORLD.say_hi(:x_in, :x_out);
end;',bindparams=[bindparam('x_in',String),outparam('x_out',String)]),x_in='matt').
However, for most of their procedures, they actually have cursors in the
outparams. The only way i have found to do it is to drop down into using a
raw_connection and the cx_oracle types like so:
engine = create_engine(dsn)
con = engine.raw_connection()
cur = conn.cursor()
people=cur.var(cx_Oracle.CURSOR)
groups=cur.var(cx_Oracle.CURSOR)
params = [12345, people, groups]
#12345 is a input param
r = cur.callproc('list_people', params)
Is there a way to keep this more abstract and within sqlalchemy instead of
dropping down into cx_Oracle?
thanks,
Matt
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/u38qIICSt5AJ.
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.