Re: [cx-oracle-users] Question on calling stored procedures using cx_Oracle
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2006-04-10 18:23:18
|
See the test suite for an example of how to call a stored procedure with an out cursor that you can then fetch from. Specifically, look at the file called "CursorVar.py". If you need more specific pointers, please let me know. On 4/10/06, Lear, Russell <Rus...@xe...> wrote: > Hi all, > > I'm a (mostly) happy user of cx_Oracle, but I've found one hole that I'd > like to find a solution to. > > I'm running I have a stored procedure looking like > > PROCEDURE RestartableJobs(c_djob OUT djob_cursor) IS > BEGIN > > OPEN c_djob FOR 'SELECT distinct job_id from jobtable > where status < cnStatusRejected and exists (select null from > activejobs where activejobs.job_id =3D jobtable.job_id)'; > NULL; > > END RestartableJobs; > > How do I call this thing? (or do I?) Clearly, in this case I could > pass in the sql myself, but duplicating existing PL/SQL code isn't too > attractive. > > >>> import cx_Oracle as cxo > >>> connection =3D cxo.connect('scott/tiger') > >>> cur =3D connection.cursor() > >>> r =3D cur.callproc('rlpkg.RestartableJobs') > Traceback (most recent call last): > File "<stdin>", line 1, in ? > cx_Oracle.DatabaseError: ORA-06550: line 1, column 7: > PLS-00306: wrong number or types of arguments in call to > 'RESTARTABLEJOBS' > ORA-06550: line 1, column 7: > PL/SQL: Statement ignored > > But I can't figure out what to pass in to it. Any hints? For what it's > worth, I'm on WinXP, using Oracle 9i, with cx_Oracle 4.1.2. > > Thanks, > Russell. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |