[cx-oracle-users] How do I bind output variables properly?
Brought to you by:
atuining
From: Tim H. <tho...@en...> - 2006-10-10 20:20:24
|
When I use the following code to return a sys_refcursor, it works great: def calldb_cursor(self, procname, args): """Call a stored procedure that has a cursor as an OUT parameter.""" outcur = self.con.cursor() args.append(outcur) self.cur.callproc(procname, args) return outcur I don't setoutputsize or var to specify a cursor type. When I use a similar approach for other OUT parameter types, I don't get any data after the call. def calldb_proc(self, procname, args): """Call a database stored procedure.""" self.cur.callproc(procname, args) example: The stored procedure takes a user name and inserts a new user into the table and fills 'uid' with a sequence-based unique id: PROCEDURE SP_ADD_USER ( uid OUT INTEGER, p_first_name IN VARCHAR2, p_last_name IN VARCHAR2); Can someone provide an example of how to call this proc with cx_Oracle setXXXsize() such that I get the proper values in in my OUT params? Thanks in advance! Tim Holcomb |