About a week ago, I asked a question about dcoracle (Included below). I got one response suggesting that I not use a cursor. However, I need a cursor to return several (lots) of rows from the database in one stored procedure call. I can't do this by adding extra non-cursor parameters. If anyone has any other ideas, I'd appreciate the help. -David Lipsky
I was wondering if you could help me with a problem I've been having with DCOrale, connecting to Oracle8i.
import DCOracle
conn = DCOracle.Connect(...)
curs = conn.cursor() conn.procedures.some_stored_procedure(curs) curs.fetchall()
curs = conn.cursor() conn.procedures.some_other_stored_procedure(curs) curs.fetchall()
some_stored_procedure and some_other_stored_procedure return different rowtypes.
Either the second call throws the following error, or it returns the wrong set of columns (it will return only those columns that were returned in the first call):
Traceback (innermost last): File "<stdin>", line 1, in ? File "/usr/lib/python1.5/DCOracle/ociProc.py", line 134, in __call__ for c in iocursors: c._describe() File "/usr/lib/python1.5/DCOracle/ociCurs.py", line 130, in _describe if rc!=1007: self._error() File "/usr/lib/python1.5/DCOracle/ociCurs.py", line 109, in _error raise error, (rc, oci_.OracleErrorMessage(self._c.lda, rc)) oci.error: (1003, 'ORA-01003: no statement parsed')
Explicitly closing the cursor between the calls doesn't seem to help, nor does reusing the same cursor. The only way I've been able to call two stored procedures in this way is by closing the connection itself between calls.
Any advice or help you can give would be greatly appreciated! If I've sent this to the wrong address, please forward it to someone who can help. Thank you!
-David Lipsky Openmind Commonsense MIT Media Lab