[Zope-DB] DCOracle2 OracleDate and parameter sequence problem

Matthew T. Kromer matt@zope.com
Tue, 09 Oct 2001 10:37:11 -0400

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Christopher Jenkins wrote:

>Thank you very much for this fix.  I have discovered a couple
>of other (related?) issues with strings and executemany().
>Suppose you have a table created by
>create table t (s char(10));
>Then from Python, given a cursor object object con:-
>>>>stmt="insert into t values (:1)"
>This call inserts three NULL values into the table
>(ie. "hello" does not get inserted).  Continuing
>>>>cur.executemany(stmt+ " ",l2) # Force reparse
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File
>line 921, in executemany
>    result = self._cursor.execute(batchend-batchstart)
>dco2.DatabaseError: (1480, 'ORA-01480: trailing null missing from STR
Using the test program I attached, I cant reproduce your error on my 
system; I did put another change into DCOracle2 yesterday; I trust you 
grabbed the CVS version?

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;


import DCOracle2

db = DCOracle2.connect('scott/tiger')
c = db.cursor()

    c.execute('drop table stest')
except DCOracle2.DatabaseError: pass

c.execute('create table stest (s char(10))')

l1 = [(None,),("hello",),(None,)]
l2 = [("",),("hello",),("",)]

stmt = "insert into stest values(:1)"

c.executemany(stmt, l1)
c.executemany(stmt, l2)

c.execute('select * from stest')
print c.fetchall()