Dear all,
how default option prevents null values from entering the columns when a row is inserted without a value for the column in oracle. But when i specify a column with a default option it inserts null value
create table hire_dates
(id number(8),
hire_date date default sysdate);
SQL> insert into hire_dates
2 values(100,null);
1 row created.
SQL> select * from hire_dates;
ID HIRE_DATE
---------- ---------
100
But When i do this
SQL> insert into hire_dates(id)
2 values(200);
1 row created.
SQL> select * from hire_dates;
ID HIRE_DATE
---------- ---------
100
100
200 20-FEB-14
So can anyone from all you seniors help me to understand how Default option will work