Submitting a batch/block of insert statements using C#?
Date: Wed, 28 Jan 2009 07:19:17 -0800 (PST)
A programmer colleague of mine asked if he could submit a batch of insert statements to Oracle (9i) using C#. And if there's any way to identify which insert statement, if any failed during the batch execution.
The idea is to improve performance by preventing client/server back and forths, e.g. better to submit 1,000 insert statements as a batch/ block, have the server execute the statements in one go, then send back a single response than to have 1,000 round-trips for each insert (rolling back if there's an error).
Can this be done in C# without any PL/SQL? If so, how? The programmer is using this mechanism to communicate with Oracle:
Although you can get a transaction defined using the above, then loop through your inserts, I don't think it's submitting everything to the server as a block. One final note: we can't use any solution requiring stored procedures on the server side; the admins won't permit it and this is a rule we can't change.
Dana Received on Wed Jan 28 2009 - 09:19:17 CST