Loop in PL/SQL

The example given below shows a While Loop. Here the value of the variable I is checked to ascertain whether it is less than 10 and as long as it is so the body of the loop will be executed.

DECLARE
I NUMBER (4) :=0;
BEGIN
WHILE (I<10)
LOOP
I:= I+1;
DBMS_OUTPUT.PUT_LINE (I);
END LOOP;
END;

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>