Constraint types: not null : Constraint Types « Constraints « Oracle PL / SQL






Constraint types: not null


SQL> --Constraint types
SQL> --There are five integrity constraints in Oracle.
SQL> --Not Null
SQL>
SQL> create table myTable (
  2    a number not null,
  3    b number     null,
  4    c number
  5  );

Table created.

SQL>
SQL> insert into myTable values (   1, null, null);

1 row created.

SQL> insert into myTable values (   2,    3,    4);

1 row created.

SQL> insert into myTable values (null,    5,    6);
insert into myTable values (null,    5,    6)
                            *
ERROR at line 1:
ORA-01400: cannot insert NULL into ("SYS"."MYTABLE"."A")


SQL>
SQL> drop table myTable;

Table dropped.

SQL>
           
       








Related examples in the same category

1.Contraint type: Unique