class="java" name="code">
declare
myexception exception;
begin
for i in 1..10
loop
begin
raise myexception;
--insert....这里为了简单 直接抛出异常
exception
when others
then
Dbms_Output.put_line('抛出异常'||'>>'||i);
--这里可以定义一个表 把错误的写进去
end;
Dbms_Output.put_line('继续执行'||'>>'||i);
end loop;
end;