Tutorial by Examples

DECLARE v_counter NUMBER(2); BEGIN v_counter := 0; LOOP v_counter := v_counter + 1; dbms_output.put_line('Line number' || v_counter); EXIT WHEN v_counter = 10; END LOOP; END;
The WHILE loop is executed untill the condition of end is fulfilled. Simple example: DECLARE v_counter NUMBER(2); --declaration of counter variable BEGIN v_counter := 0; --point of start, first value of our iteration WHILE v_counter < 10 LOOP --exit condition dbms_output....
Loop FOR works on similar rules as other loops. FOR loop is executed exact number of times and this number is known at the beginning - lower and upper limits are directly set in code. In every step in this example, loop is increment by 1. Simple example: DECLARE v_counter NUMBER(2); --declaration...

Page 1 of 1