Q:

Write a program in PL/SQL using loop with CONTINUE WHEN statement

0

Write a program in PL/SQL using loop with CONTINUE WHEN statement.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

PL/SQL Code:

DECLARE
  n NUMBER := 0;
BEGIN
  LOOP -- After CONTINUE statement, control resumes here
    DBMS_OUTPUT.PUT_LINE ('The value inside the loop:  n = ' || TO_CHAR(n));
    n := n + 1;
    CONTINUE WHEN n < 4;
    DBMS_OUTPUT.PUT_LINE
      ('The value inside loop, after CONTINUE:  n = ' || TO_CHAR(n));
    EXIT WHEN n = 6;
  END LOOP;
  DBMS_OUTPUT.PUT_LINE ('The value after exit from the loop:  n = ' || TO_CHAR(n));
END;
/

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now