ORACLE continue(1)

declare
begin
  for CUR in (select LEVEL A from dual  connect by level<=10) loop
    declare
      my_exscep EXCEPTION;
    BEGIN
      IF (CUR.A = 5 OR CUR.A=7) THEN
        RAISE my_exscep;
      ELSE
         dbms_output.put_line(CUR.A);
      END IF;
    EXCEPTION
      WHEN my_exscep THEN
        dbms_output.put_line('dont update now!!');
    END;
  END LOOP;
END;

 

第二種:

    

for ... loop
...
if somecondition then
   goto nextloop;
end if;
...

<<nextloop>>
   null;
end loop;

 

posted on 2011-08-12 15:29  Mayvar  阅读(350)  评论(0编辑  收藏  举报

导航