FOR operatorining qo‘llanilishi
DECLARE
son INTEGER:=0;
BEGIN FOR son IN 0 .. 10 LOOP
DBMS_OUTPUT.PUT(son | |’ ’);
END LOOP;
DBMS_OUTPUT.PUT_LINE(‘Sikl tugadi!’);
END;
Natija: 0 1 2 3 4 5 6 7 8 9
Sikl tugadi!
Statement processed.
IF ..ELSIF ..ELSE shartli operatorining qo‘llanilishi
PL/SQL dasturlash tilida shartli
mantiqiy amal bajarishda IF
operatoridan foydalaniladi.
Umumiy sintaksisi quyidagicha:
IF THEN
; ;
ELSIF THEN ; ; ELSE ;
;
END IF;
Misol.
DECLARE
Son INTEGER:=0;
BEGIN
FOR son IN 1 ..20 LOOP
IF ((son MOD 3 = 0) AND (son MOD 5 = 0))
THEN DBMS_OUTPUT.PUT(’Ikkalasiga karrali ’);