null with default value column : Default Column Value « Table « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> create table t
  2  (id number primary key,
  3  status char(1) default 'Y')
  4  /

Table created.

SQL>
SQL> create sequence s;

Sequence created.

SQL>
SQL> insert into t
  2  (id)
  3  values(s.nextval);

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL>
SQL> insert into t
  2  (id, status)
  3  values(s.nextval, 'N');

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL>
SQL> commit;

Commit complete.

SQL>
SQL> drop table t;

Table dropped.








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