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;