LOOPS = ONE STATEMENT REPEAT MORE TIME
1. BASIC LOOP 2. WHILE LOOP 3. FOR LOOP
DECLARE
A NUMBER:=0;
BEGIN
LOOP
A:=A+1;
EXIT WHEN A > 10;
DBMS_OUTPUT.PUT_LINE(A);
END LOOP;
END;
1
2
3
--------------------------------------------------------------------
DECLARE
A NUMBER:=0;
BEGIN
WHILE A < 10 LOOP
A:=A+1;
DBMS_OUTPUT.PUT_LINE(A);
END LOOP;
END;
1
2
3.....
---------------------------------------------------------------------
BEGIN
FOR A IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(A);
END LOOP;
END;
1
2
3.........
1. BASIC LOOP 2. WHILE LOOP 3. FOR LOOP
DECLARE
A NUMBER:=0;
BEGIN
LOOP
A:=A+1;
EXIT WHEN A > 10;
DBMS_OUTPUT.PUT_LINE(A);
END LOOP;
END;
1
2
3
--------------------------------------------------------------------
DECLARE
A NUMBER:=0;
BEGIN
WHILE A < 10 LOOP
A:=A+1;
DBMS_OUTPUT.PUT_LINE(A);
END LOOP;
END;
1
2
3.....
---------------------------------------------------------------------
BEGIN
FOR A IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(A);
END LOOP;
END;
1
2
3.........