Solved

batch updates in dot net using Oracle database

Posted on 2007-11-26
5
1,039 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 74

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 74

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 74

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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

705 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