Write a program in PL/SQL to print the value of a variable inside and outside a loop using LOOP WHEN EXIT statement.
PL/SQL Code:
DECLARE n NUMBER := 0; BEGIN LOOP DBMS_OUTPUT.PUT_LINE('The value of n inside the loop is: ' || TO_CHAR(n)); n := n + 1; EXIT WHEN n > 5; END LOOP; DBMS_OUTPUT.PUT_LINE('The value of n after exit from the loop is: ' || TO_CHAR(n)); END; /
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
PL/SQL Code: