ORA-06550: line 34, column 4:
PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND table of records
create table tmp_table1 as select col1, col2, col3, col4, col5, col6 from table1 where 1 = 2;
declare
cursor curOrders is
select
a.col1, a.col2, a.col3, a.col4, a.col5, a.col6
from
table1 a
join
table2 b
on a.col1 = b.col1 and a.col2 = b.col2;
type tbl_bulk is table of curOrders%rowtype;
varOrders tbl_bulk;
begin
open curOrders;
loop
fetch curOrders bulk collect into varOrders limit 500;
forall indx in 1 .. varOrders.count
insert into tmp_table1
(col1, col2, col3, col4, col5, col6)
values
(varOrders(indx).col1, varOrders(indx).col2, varOrders (indx).col3, varOrders(indx).col4, varOrders(indx).col5, varOrders(indx).col6);
exit when curOrders%notfound;
--exit when varClaims.count < 500; which is better?
end loop;
close curOrders;
commit;
end;
/
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>
Our community of experts have been thoroughly vetted for their expertise and industry experience.