Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / PL SQL Data Types
 

Boolean variables can be assigned either directly by using values TRUE, FALSE, or NULL or as the results of logical expr

SQL> SQL> declare   2      v_b BOOLEAN:=false;   3  begin   4      v_b:=extract(year from sysdate)>2000;   5      if v_b then   6          DBMS_OUTPUT.put_line('21st Century!');   7      end if;   8  end;   9  / 21st Century! PL/SQL procedure successfully completed. SQL>