Bulk Processing with BULK COLLECT and FORALL
BULK COLLECT: SELECT statements that retrieve multiple rows with a single fetch, improving the speed of data retrieval
FORALL: INSERTs, UPDATEs, and DELETEs that use collections to change multiple rows of data very quickly
BULK COLLECT
declare
type t_plsql_type is table of employee%rowtype index by pls_integer;
vt_plsql_type t_plsql_type;
begin
select * bulk collect into vt_plsql_type from employee ;
for v_typ_idx in 1..vt_plsql_type.count loop
dbms_output.put_line(vt_plsql_type(v_typ_idx).emp_id);
end loop;
end ;
FORALL
BULK COLLECT
declare
type t_plsql_type is table of employee%rowtype index by pls_integer;
vt_plsql_type t_plsql_type;
begin
select * bulk collect into vt_plsql_type from employee ;
for v_typ_idx in 1..vt_plsql_type.count loop
dbms_output.put_line(vt_plsql_type(v_typ_idx).emp_id);
end loop;
end ;
FORALL
No comments:
Post a Comment