1. 程式人生 > >oracle 10g不支援 continue解決方法

oracle 10g不支援 continue解決方法

解決方案如下 :
採用goto進行跳轉

DECLARE
   done  BOOLEAN;
BEGIN
   FOR i IN 1..50 LOOP
      IF done THEN
         GOTO end_loop;
      END IF;
   <<end_loop>>  -- not allowed unless an executable statement follows
   NULL; -- add NULL statement to avoid error
   END LOOP;  -- raises an error
without the previous NULL END;

11g增加continue關鍵字用法如下

DECLARE
   done  BOOLEAN;
BEGIN
   FOR i IN 1..50 LOOP
      IF done THEN
        continue;
      END IF;
   END LOOP;  
END;