Skip to content

CONTINUE

DECLARE
i number := 1;
BEGIN
WHILE i <= 10 LOOP
IF i = 5 THEN
i := i + 1;
CONTINUE;
END IF;
dbms_output.put_line(i);
i := i+1;
END LOOP;
END;
1
2
3
4
6
7
8
9
10

In the above example, a loop runs ten times, printing numbers from 1 to 10. However, when the number is 5, the CONTINUE statement is encountered. This causes the control to go back to the start of the loop, skipping the print statement for the number 5. Thus, the output doesn’t include 5.