Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / PL SQL Statements
 

Comparing with NULL

SQL> SQL> declare   2      v NUMBER;   3  begin   4      if v = 1 then   5          DBMS_OUTPUT.put_line('Equal to 1');   6      elsif v!= 1 then   7          DBMS_OUTPUT.put_line('Not equal to 1');   8      elsif v = v then   9          DBMS_OUTPUT.put_line('Equal to itself');  10      else  11          DBMS_OUTPUT.put_line('Undefined result');  12      end if;  13      v:=v+1;  14      DBMS_OUTPUT.put_line('New value: <'||v||'>');  15  end;  16  / Undefined result New value: <> PL/SQL procedure successfully completed. SQL>