Default char value : Column Default Value « Table « Oracle PL / SQL






Default char value

   

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.

SQL> drop sequence s;

Sequence dropped.

SQL>

   
    
    
  








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.null with default value column
6.Default varchar value
7.Use char function to build default column value