存储过程 跳出

https://www.cnblogs.com/yw0219/p/5939558.html

记录exit和return的用法 
exit用来跳出循环 
loop 
IF V_KBP IS NULL THEN 
          EXIT; 
   END IF; 
end loop; 

return跳出存储过程 
loop 
IF V_KBP IS NULL THEN 
        return; 
   END IF; 
end loop; 

跳出loop 一次循环 
oracle 11g已提供continue; 
oracle 10g及以下,使用goto来替代,例如 

SQL> set serveroutput on; 
SQL> declare 
  2  begin 
  3    for i in 1..10 loop 
  4      if mod(i,2)=0 then 
  5        goto next; 
  6      end if; 
  7      dbms_output.put_line(i); 
  8      <<next>> 
  9      null; 
10    end loop; 
11  end; 
12  / 
注意:<<next>>标签后的null;语句不可少,因为goto标签后必须紧接着一个执行语句

原文地址:https://www.cnblogs.com/Struts-pring/p/11490670.html