We help IT Professionals succeed at work.
Get Started

Bulk Collect / Forall insert PLS-00436 error.

Scarlett72
Scarlett72 asked
on
429 Views
Last Modified: 2016-02-25
Hi, I am running the following code to create a forall insert but I am receiving the following error and cannot figure out why ...  I'm not sure what this error message is telling me.  Thanks,

ORA-06550: line 34, column 4:
PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND table of records

Open in new window


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;
/

Open in new window

Comment
Watch Question
Software Developer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 6 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE