CONTINUE
Translation reference to convert Oracle CONTINUE statement to Snowflake Scripting
Description
The
CONTINUEstatement exits the current iteration of a loop, either conditionally or unconditionally, and transfers control to the next iteration of either the current loop or an enclosing labeled loop. (Oracle PL/SQL Language Reference CONTINUE Statement)
CONTINUE [ label ] [ WHEN boolean_expression ] ;{ CONTINUE | ITERATE } [ <label> ] ;Sample Source Patterns
1. Simple Continue
Code skips the INSERT statement by using CONTINUE.
This case is functionally equivalent.
Oracle
CREATE TABLE continue_testing_table_1
(
iterator VARCHAR2(5)
);
CREATE OR REPLACE PROCEDURE continue_procedure_1
IS
I NUMBER := 0;
J NUMBER := 20;
BEGIN
WHILE I <= J LOOP
I := I + 1;
CONTINUE;
INSERT INTO continue_testing_table_1 VALUES(TO_CHAR(I));
END LOOP;
END;
CALL continue_procedure_1();
SELECT * FROM continue_testing_table_1;ITERATOR|
--------+Snowflake Scripting
2. Continue with condition
Code skips inserting even numbers by using CONTINUE.
Oracle
Snowflake Scripting
3. Continue with label and condition
Code skips line 19, and the inner loop is only executed once because the CONTINUE is always jumping to the outer loop using the label.
This case is functionally equivalent applying the same process as the previous sample.
Oracle
Snowflake Scripting
Known Issues
No issues were found.
Related EWIs
No related EWIs.
Last updated
Was this helpful?