oracle for loop 1

oracle for loop

DECLARE
    i NUMBER;
BEGIN
    FOR i IN 1..5
        LOOP
            dbms_output.PUT_LINE('i value : ' || i);
        END LOOP;
END;

Here is what the above code is Doing:
1. Declare a variable i of type number.
2. Start a loop that will run 5 times.
3. Print the value of i.
4. Increment the value of i by 1.
5. Repeat steps 3 and 4 until the loop has run 5 times.

Similar Posts