Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: When to use bulk bind?
No rule of thumb (if you are doing something in a loop, see if you could
*bulk* the operation), but for an example code like this
for I in array.first .. array.last
loop
update some_table
set some_column = array(i).value
where other_column = array(i).column;
end loop;
You'd benefit from using a bulk bind with FORALL.
forall i in array.first array.last
update some_table
set some_column = array(i).value
where other_column = array(i).column;
Syntax might change based on what version you are on ... but this should
give you some idea.
It depends on your processing of data.
Raj
-----Original Message-----
Sent: Thursday, May 01, 2003 2:57 PM
To: Multiple recipients of list ORACLE-L
We have a batch process that does a long series of updates, inserts, and deletes. Right now we are using a script to execute sql.
When is it appropriate to move this to PL/SQL and use array processing? couple of things I thought of...
select stuff
from big_table
where column = 'BLAH'
Would it be a good idea to bulk collect the rowids or even just select the entire row into a pl/sql table? and essentially break the table up into 5 smaller tables?
then do a forall statement to do my update?
In general when should you move from update, insert,delete statements with sub-queries to array processing? anyone have any rules of thumb?
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: <rgaffuri_at_cox.net
INET: rgaffuri_at_cox.net
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Jamadagni, Rajendra
INET: Rajendra.Jamadagni_at_espn.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).