[Zope] DCOracle Problem

David A Lipsky lippo@MIT.EDU
Thu, 29 Jun 2000 11:30:46 -0400


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.


Here's an actual session:


Note that get_sentence_ids should return one integer per row,
and get_sentences should return that integer along with some
text.

>>> import DCOracle

>>> conn = DCOracle.Connect('********/********')

>>> curs = conn.cursor()
>>> conn.procedures.get_sentence_ids(curs)
>>> curs.fetchall()
[(6,), (5,), (8,)]

>>> conn.procedures.get_sentences(curs)
>>> curs.fetchall()
[(6,), (5,), (8,)]

>>> curs = conn.cursor()
>>> conn.procedures.get_sentences(curs)
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')           


Any advice or help you can give would be greatly appreciated.  Thanks!


-David Lipsky
Openmind Commonsense Group
MIT Media Lab