在循环里面对可能的异常处用一个
begin  
......exception when ....   end 包括起来
就可以继续处理了!

解决方案 »

  1.   

    create or replace procedure pcon is
      j int;
    begin
      for i in 1..10 loop
        begin
          if i=3 then
            j:=i/0;
          end if;      
          
          dbms_output.put_line(i);
          
          exception 
            when others then
              null;              
        end;
        
      end loop;
    end;
      

  2.   

    SQL> set serveroutput on
    SQL> exec pcon
    1
    2
    4
    5
    6
    7
    8
    9
    10PL/SQL procedure successfully completed