'CONTINUE' keyword in Oracle 10g PL/SQL

后端 未结 9 2167
失恋的感觉
失恋的感觉 2020-12-14 06:00

I\'m migrating a TSQL stored procedure to PL/SQL and have encountered a problem - the lack of a CONTINUE keyword in Oracle 10g.

I\'ve read that Oracle 11g has this a

9条回答
  •  春和景丽
    2020-12-14 06:54

    You can simulate a continue using goto and labels.

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

提交回复
热议问题