SQL> create table test1(id number, col varchar2(16) default 'DEF' NOT NULL);
Table created.
SQL> insert into test1(id, col) values(1, NULL);
insert into test1(id, col) values(1, NULL)
*
ERROR at line 1:
ORA-01400: cannot insert NULL into ("SYS"."TEST1"."COL")
SQL> desc test1
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER
COL NOT NULL VARCHAR2(16)
oerr ora 01400
01400, 00000, "cannot insert NULL into (%s)"
// *Cause: An attempt was made to insert NULL into previously listed objects.
// *Action: These objects cannot accept NULL values.
SQL> insert into test1(id, col) values(1);
insert into test1(id, col) values(1)
*
ERROR at line 1:
ORA-00947: not enough values
SQL> insert into test1(id) values(1);
1 row created.
SQL> select * from test1;
ID COL
---------- --------------------------------
1 DEF
|