Solved

batch updates in dot net using Oracle database

Posted on 2007-11-26
5
1,022 Views
Last Modified: 2013-12-18
hi,

i have to do 56 insertion records on a single postback.

any body tell me how to use batch update of oracle in dot net.

or any other optimized way

thanks
0
Comment
Question by:sitg
  • 3
5 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 20349947
0
 

Author Comment

by:sitg
ID: 20350053
hi,

but it works for only one type of query.
 But i have three queries which are executed 17 times each.

i wanted to supply all the queries once to the oracle.

is is possible.
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 20350214
no that's not possible.

the closest you could get would be a pl/sql procedure that does the 3 queries for you,  doesn't really reduce the work load at all. but might make your code simpler.
0
 
LVL 27

Expert Comment

by:sujith80
ID: 20355258
>> or any other optimized way

You could make use of array insertions( bulk operations) in oracle pl/sql. The data in the array is sent as a single unit.This reduces the network round trips between your calling program and the database server.

The pl/sql code takes the following form.

declare
 -- array type declaration
 -- array variable declaration
begin
 forall in in <array variable>.first..<array variable>.last
  insert into <your table>(column name) values(<array variable1>(i), <array variable2>(i).....);

end;
/
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 20357832
that's essentially the same thing as the bulk operations with array binding except you're bulk binding pl/sql arrays instead of c# arrays.

Unfortunately, that doesn't help the problem of trying to do 3 different things.    If all the data could be passed to a single stored procedure as suggested above, then the contents of that procedure might look something like sujith80's template code, except copied 3 times, once for each query.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now