In Oracle, you ‘re using a PL/SQL WHILE LOOP where you’re not sure how many times you ‘re going to perform the body of the loop and the body of the loop may not only run yet in Oracle R12 Application.
While Loop Syntax
WHILE condition LOOP Executable statements; END LOOP;
Example to print the statement using While LOOP
DECLARE a number(10) := 1; BEGIN WHILE a <= 10 LOOP a := a+1; dbms_output.out_line(a); END LOOP; END;
You ‘d use a WHILE LOOP statement when you’re unsure how many times you want to execute the body of the loop, Since the condition of WHILE is evaluated before entering the loop, it is possible that the body of the loop may not even execute once.