Oracle Tip: How to use default values with database columns
create table t1
(
id$ integer not null,
charcol char default 'Y',
datecol date default sysdate,
strcol varchar2(30) default user,
intcol integer default 12
);
insert into t1 (id$) values (1);
select * from t1;
ID$ C DATECOL STRCOL INTCOL
---------- - --------- ------------------------------ ----------
1 Y 28-MAY-04 SCOTT 12
create table t1
(
id$ integer not null,
charcol char default 'Y',
datecol date default sysdate,
strcol varchar2(30) default user,
intcol integer default 12
);
insert into t1 (id$) values (1);
select * from t1;
ID$ C DATECOL STRCOL INTCOL
---------- - --------- ------------------------------ ----------
1 Y 28-MAY-04 SCOTT 12