FOR LOOP ORACLE code example
Example 1: for loop in oracle
DECLARE
count number(2) := 10;
BEGIN
FOR count in 10..20 (FOR count in REVERSE 10..20)
LOOP
dbms_output.put_line("COUNT : " || count);
END LOOP;
END;
Example 2: for plsql
FOR contatore IN lower bound..upper bound
LOOP
...
END LOOP;
Example 3: for loop oracle
FOR loop_counter IN [REVERSE] lowest_number..highest_number
LOOP
{...statements...}
END LOOP;
FOR record_index in cursor_name
LOOP
{...statements...}
END LOOP;
OPEN c_customers;
LOOP
FETCH c_customers into c_rowtype_var;
EXIT WHEN c_customers%notfound;
{...statements...};
END LOOP;
Example 4: pl sql for each loop
FOR record IN cursor_name
LOOP
process_record_statements;
END LOOP;