Bulk collect Error
AppleMar 22 2010 — edited Mar 23 2010SQL> ed
Wrote file afiedt.buf
1 Declare
2 Type t_emp_type Is Table Of emp%Rowtype Index By Binary_Integer;
3 t_emp_tab t_emp_type;
4 e_bulk Exception;
5 Pragma Exception_Init(e_bulk, -20000);
6 Begin
7 Select * Bulk Collect Into t_emp_tab From emp Order By empno;
8 Forall i In t_emp_tab.First..t_emp_tab.Last save Exceptions
9 Insert Into emp_bulk Values t_emp_tab(i);
10 Exception
11 When e_bulk Then
12 For j In 1..Sql%bulk_exceptions.Count
13 Loop
14 Dbms_Output.put_Line (t_emp_tab(Sql%bulk_exceptions(j).error_index).empno
15 || ' , ' ||t_emp_tab(Sql%bulk_exceptions(j).error_index).ename
16 ||' , (sal ='||t_emp_tab(Sql%bulk_exceptions(j).error_index).Sal
17 || ' ) :' ||Sqlerrm (-Sql%bulk_exceptions(j).error_code)
18 );
19 End Loop;
20* End;
SQL> /
ERROR:
ORA-24381: error(s) in array DML
ORA-06512: at line 8
where i am wrong?