Date type column with current date as the default value : Default Column Value « Table « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> create table WORK_T (
  2  id                             number,
  3  code                           varchar2(30),
  4  name                           varchar2(80),
  5  active_date                    date          default SYSDATE  not null,
  6  inactive_date                  date );

Table created.

SQL>
SQL>
SQL> drop   table WORK_T;

Table dropped.

SQL>
SQL>
SQL>








6.14.Default Column Value
6.14.1.Using Default Values
6.14.2.Insert record into a table with default value
6.14.3.Override the defaults by specifying a value for the columns
6.14.4.Update a column and set it back to the default using the DEFAULT keyword in an UPDATE statement
6.14.5.Update statement with default
6.14.6.Add a column with default value
6.14.7.Date type column with current date as the default value
6.14.8.null with default value column