[DB-SIG] Insert for Oracledb

M.-A. Lemburg lemburg@uni-duesseldorf.de
Sun, 23 Nov 1997 14:12:15 +0100


Bill Tutt wrote:
> 
> M-A is correct in that is the say things should happen, but oracledb-0.1.3
> doesn't do that currently.
> Neither does the Win32 ODBC module either.. (All patches to fix the problem
> graciouslly excepted).

They don't ? Sorry, I didn't know that (not using them so...). If
Oracle has an ODBC interface lib, you could try the mxODBC-module, which
does allow lists of tuples to be passed to .execute(). Also, for those
who work on the Win32 ODBC module: you might be able to use some
of the code in there...

        http://starship.skyport.net/~lemburg/mxODBC.html

> Passing a tuple of tuples to an insert() should ONLY be used inside a
> transaction, because if you don't
> you won't know where in the #  of rows to insert, the failure occurred..
> Wether this is a good thing or bad thing depends on your situtation.

ODBC has an interface to return the row number where the
error occurred. If the module does the executes one at a
time the information is also available. What's missing in
both cases is a standard of how to access the row number.
Maybe the execute should return the number of rows successfully
executed (it'll stop executing whenever an error occurs, so
that number would in this case indicate the error position
in the list).

As I am new to the list: has there been discussion about
what to do with the auto-commit feature in ODBC ? I've switched
it off per default but made an interface available to turn it
back on, since I find it rather useful in situations where
concurrent access to the DB is important.

-- 
Marc-Andre Lemburg


_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________