PL/SQL Continue statement

CONTINUE STATEMENT IN PL-SQL

Continue Statement:

  • Adds the functionality to begin the next loop iteration
  • Provides programmers with the ability to transfer control to the next iteration of a loop

Example:

DECLARE
v_total number := 0;
BEGIN
FOR i IN 1..5 LOOP
v_total := v_total + i;
dbms_output.put_line('Total is: '|| v_total);
CONTINUE WHEN i > 3;
v_total := v_total + i;
dbms_output.put_line('Out of Loop Total is:'|| v_total);
END LOOP;
END;

Output:

Leave a Reply

Your email address will not be published. Required fields are marked *