[Zope-DB] DCOracle2 OracleDate and parameter sequence problem

Christopher Jenkins cjenkin1@stanwell.com
Fri, 05 Oct 2001 12:13:01 +1000


Hi,

I have recently started to use DCOracle2 beta5 (Oracle 9.0.1
on Sparc Solaris and Python 2.1.1) and have encountered
some strange problems when using OracleDate objects in
parameter sequences and either execute() or executemany().

To illustrate the problems, consider a table created by

create table t (d date);

Now from Python, if I have a cursor object cur

>>> d=DCOracle2.TimestampFromTicks(time.time())
>>> stmt = "insert into t values (:1)"
>>> cur.execute(stmt, (d,))
4
>>> cur.execute(stmt, (None,))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/cjenkin1/oracle/DCO2/DCOracle2/DCOracle2.py", line 743, in
execute
    result = self._cursor.execute()
dco2.DatabaseError: (1475, 'ORA-01475: must reparse cursor to change
bind variable datatype')

>>> cur.executemany(stmt, [(None,),(None,)])
4
>>> cur.executemany(stmt, [(d,),(d,)])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/cjenkin1/oracle/DCO2/DCOracle2/DCOracle2.py", line 837, in
executemany
    baoa[c][br] = p
OverflowError: Assigned value too large  for Binding Array

>>> cur.executemany(stmt, [(None,),(d,)])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/cjenkin1/oracle/DCO2/DCOracle2/DCOracle2.py", line 837, in
executemany
    baoa[c][br] = p
OverflowError: Assigned value too large  for Binding Array


I have not encountered these problems when using other types
(eg. floats).

I would appreciate any help or suggestions.

Thanks,

Chris