USE MOD operator in IF statement : MOD « PL SQL Operators « Oracle PL/SQL Tutorial






SQL>
SQL> set serveroutput on
SQL> set echo on
SQL>
SQL> BEGIN
  2       FOR v_loopcounter IN 1..6 LOOP
  3            IF MOD(v_loopcounter,2) = 0 THEN
  4                 DBMS_OUTPUT.PUT_LINE('Loop counter is ' || v_loopcounter);
  5            END IF; -- End execution of statements for even counter
  6       END LOOP;
  7  END;
  8  /
Loop counter is 2
Loop counter is 4
Loop counter is 6

PL/SQL procedure successfully completed.

SQL>
SQL>








23.7.MOD
23.7.1.USE MOD operator in IF statement