EXIT
Exits from the current loop to the statement after the loop construct or to the construct that contains the current loop.Typically, a condition would be tested in a loop, and the exit would be based upon the evaluation of that condition.This example continues the execution of the statements between theLOOP
andEND LOOP
, depending on the value of the conditiona > b
.The iterations go on as long as the statusst
is equal to 0. Whenst
is not equal tostm_success
, it causes the iterations to stop. TheIF
statement here is used to force an abnormalEXIT
from within theWHILE
loop.WHILE a > b LOOP
md_id := stm_r_md (name, st);
IF st <> stm_success THEN
WRITE (‘Illegal Status’);
EXIT;
END IF;
.
.
END LOOP;
●
●