Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bulk collect Error

AppleMar 22 2010 — edited Mar 23 2010
SQL> 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2010
Added on Mar 22 2010
20 comments
2,888 views