Hi ,
Actuall i was trying the below link to see the performance difffernce
but using the simple cursor it went into infinite loop
making a deadlock on second table test_emp2
can anybody tell what mistake i am doing ?
link:-
Refer :- https://venzi.wordpress.com/2007/09/27/bulk-collect-forall-vs-cursor-for-loop/
create table test_emp1
(
id number
);
begin
for i in 1..100 loop
insert into test_emp1 values(i);
end loop;
end ;
create table test_emp2
( id number
);
create or replace procedure cursor_test
is
cursor c1 is select id from
test_emp1;
l_id varchar2(100);
begin
dbms_output.put_line('before insert'||systimestamp);
open c1 ;
loop
fetch c1 into l_id ;
insert into test_emp2 values(l_id);
end loop;
close c1;
dbms_output.put_line('after inserting' ||systimestamp);
end ;