Published: 2/19/2026 For Loops Examples of For Loops Simple PL/SQL FOR LOOP BEGIN FOR l_counter IN 1..5 LOOP DBMS_OUTPUT.PUT_LINE( l_counter ); END LOOP; END;Simulating STEP clause in FOR LOOP statement DECLARE l_step PLS_INTEGER := 2; BEGIN FOR l_counter IN 1..5 LOOP dbms_output.put_line (l_counter * l_step); END LOOP; END;FOR LOOP with a SELECT statement exampleBEGIN FOR l_rec IN ( SELECT column FROM table ORDER BY column DESC ) LOOP dbms_output.put_line( l_rec.column ); END LOOP; END;