Declare not null variable : Not Null Variable « PL SQL « Oracle PL / SQL






Declare not null variable

SQL>
SQL> -- declare not null variable
SQL>
SQL>  declare
  2      l_number number not null := 1;
  3      l_another_number number;
  4    begin
  5      l_number := 2;
  6      l_number := l_another_number;
  7    end;
  8    /
 declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 6


SQL>

           
       








Related examples in the same category

1.NOT NULL specification which means you must initialize it