This patch adds array dml to oratcl. This allows for
seriously improved performance when insert/updating a
lot of data. Instead of executing an insert/update for
each row oratcl will now allow you to past a list of
values to be inserted/updated and it will send all of
this data to the database to be processed. See orabind
for more on this.
The statement will also execute in batch error mode.
This allows Oracle to process *all* the data and then
just let you know which rows failed so you can correct
them and retry. See oramsg for more on this.
See the docs. The orabind, and oramsg commands were
modified to make this new feature work.
Examples:
-----------------------------------------------
set sql "insert into mytable (col1) values (:val1)"
set values [list 1 2 3 4 5]
oraparse $stmt $sql
orabind $stmt -arraydml :val1 $values
oraexec $stmt
-----------------------------------------------
The example above will insert 5 rows, one row for each
of the values in the list. And it will do it *very*
fast compared to calling orabind/oraexec 5 times.
This patch was made against the oratcl-4-1-branch.
Performance
----------------------------------------------
INSERTING 5000 rows (array dml): 3.33 seconds
INSERTING 5000 rows (orabind/oraexec): 28.85 seconds
Array DML (patch against oratcl-4-1-branch)
Logged In: YES
user_id=92123
Jeremy, thanks for your patch, it is under review and if
possible, I will include it (or a slighlty modified version)
in the next release.
If you are still monitoring this thread, do you have a
current patch for version 4.3 ?
-Todd
Logged In: YES
user_id=1031
Sorry, I don't have a patch against anything recent.
Logged In: YES
user_id=92123
Originator: NO
Hello Jeremy,
I know its a bit late, but if you can still get this I wanted to tell you that this patch will be included in the upcoming 4.5 oratcl release.
Thanks
-Todd