
18.03 HOW TO USE SIMPLE LOOP
loop
exit when <<variable>> = 100;
end loop;
For Example:
declare
some-val number;
cumulative-value number;
begin
some-val : = 35 ; -- initital value assigned loop
exit when cumulative-value > 2000 -- sets the value to discontinue looping
cumulative-value := cumulative-value + some-Val;
some-Val := some-Val + 1;
end loop;
end;
Here it will go on add as 35 + 36 + 37 + 38 ….. and when the cumulative value exceeds 2000 this program quits and stop incrementing the some-val variable,
Describe what you're looking for in as much detail as you'd like.
Our AI reads your request and finds the best matching books for you.
Popular searches:
Join 2.9 million readers and get unlimited free ebooks