You can use:
Bulk collect along with FOR ALL that is called Bulk binding
.
Because PL/SQL forall
operator speeds 30x faster for simple table inserts.
BULK_COLLECT
and Oracle FORALL
together these two features are known as Bulk Binding
. Bulk Binds are a PL/SQL technique where, instead of multiple individual SELECT
, INSERT
, UPDATE
or DELETE
statements are executed to retrieve from, or store data in, at table, all of the operations are carried out at once, in bulk. This avoids the context-switching you get when the PL/SQL engine has to pass over to the SQL engine, then back to the PL/SQL engine, and so on, when you individually access rows one at a time. To do bulk binds with INSERT
, UPDATE
, and DELETE
statements, you enclose the SQL statement within a PL/SQL FORALL
statement. To do bulk binds with SELECT
statements, you include the BULK COLLECT
clause in the SELECT
statement instead of using INTO
.
It improves performance.