Oracle Add Date Column to Existing Table (default to sysdate new rows only) Oracle Add Date Column to Existing Table (default to sysdate new rows only) sql sql

Oracle Add Date Column to Existing Table (default to sysdate new rows only)


You need to first add the column without a default:

alter table mytable add date_created date default null;

and then add define the default value:

alter table mytable modify date_created default sysdate;