Check value of PLS_INTEGER type variable : PLS_INTEGER « Data Type « Oracle PL / SQL






Check value of PLS_INTEGER type variable

   
SQL>
SQL>
SQL> DECLARE
  2     lv_test_num1 PLS_INTEGER := 5;
  3     lv_test_num2 PLS_INTEGER := 10;
  4     lv_test_num3 PLS_INTEGER := 15;
  5     lv_test_num4 PLS_INTEGER := 5;
  6  BEGIN
  7     IF lv_test_num1 = lv_test_num2 THEN
  8        DBMS_OUTPUT.PUT_LINE('Test 1 and Test 2 Equal');
  9     ELSIF lv_test_num1 = lv_test_num3 THEN
 10        DBMS_OUTPUT.PUT_LINE('Test 1 and Test 3 Equal');
 11     ELSIF lv_test_num1 = lv_test_num4 THEN
 12        DBMS_OUTPUT.PUT_LINE('Test 1 and Test 4 Equal');
 13     ELSE
 14        DBMS_OUTPUT.PUT_LINE('Test 1 Not Equal to Test 2,3 or 4');
 15     END IF;
 16  END;
 17  /
Test 1 and Test 4 Equal

PL/SQL procedure successfully completed.

SQL>

   
    
  








Related examples in the same category

1.PLS_INTEGER variable
2.Assign loop counter to pls_integer type variable
3.Calculation with pls_integer
4.Count with pls_integer type variable
5.PLS_Integer type variable
6.The index variable is a PLS_INTEGER datatype number.
7.Calculate a grand total