Re: [cx-oracle-users] How do I bind output variables properly?
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2006-10-10 20:53:51
|
Hmm, not sure exactly what you are trying to accomplish so I'll give you a few pointers. If they don't help you any, please send some actual code that you are attempting to execute -- not just the PL/SQL but also the Python and the code that calls the Python method. 1) cursor.callproc() returns a modified list of arguments -- see the DB API for more details 2) cursor.var() is available to create a variable that you can pass in and get a value out after the call is complete Hopefully this helps. On 10/10/06, Tim Holcomb <tho...@en...> wrote: > 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 > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |