For Loop in PL/SQL
Advertisements
For Loop in PL/SQL
Set of instructions given to the compiler to execute set of statements until condition becomes false is called loops. The basic purpose of loop is code repetition that means same code repeated again and again. Here we discuss for loop in PLSQL
A for loop is used to execute a set of statements for a predetermined number of times.
Syntax
for variable in initial_value .. final_value loop statements; end loop;
Print Hello word five times
Example of For Loop in PLSQL
begin for i in 1 .. 4 loop dbms_output.put_line("Hello"); end loop; end;
Output
Hello Hello Hello Hello Hello
Google Advertisment