Numeric FOR loops
Illustrative PL/SQL blocks/codes using database tables
In simple loops, a set of statements enclosed between LOOP and END LOOP are executed repeatedly until a stopping condition is provided. WHILE loops execute a set of statements while a condition is TRUE and FOR loops help in executing a set of statements fixed number of times. However, when the number of iterations is not known, the WHILE loop is preferable. PL/SQL provides two kinds of FOR loops viz. Numeric For loops and CURSOR FOR loops. Cursor For loops will be discussed in the next chapter.