Wednesday, July 11, 2012

import failed by not null constraint in oracle

Prolblem: when you import data to the same table but with a new nut null constraint, Your import will failed because of the not null constraint.

Solution: remove the constraint. load data. update with default value and add constraint back.

sql:

alter table test modify column tttt datatype null;
update table test set tttt=default value;
alter table test modify column ttt datatype not null default x;


reference:
http://ss64.com/ora/table_a_cols.html

No comments:

Post a Comment