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






null with default value column

   

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.

   
    
    
  








Related examples in the same category

1.Override the defaults by specifying a value for the columns
2.Create table with column having the default value
3.column with default as sysdate
4.Use rpad to fill default value to a column
5.Default char value
6.Default varchar value
7.Use char function to build default column value