0
点赞
收藏
分享

微信扫一扫

ORA-01758: table must be empty to add mandatory (NOT NULL) column


 

http://ora-01758.ora-code.com/

ORA-01758:

table must be empty to add mandatory (NOT NULL) column

Cause:

It is not possible to define a new column as NOT NULL if rows already exist in the table being modified.

Action:

Retry the statement without the NOT NULL specification.

 

 

alter table GCD.DAILY_ACCRUAL_VIRTUS_STAG add
 (
     ASOFDATE       DATE NOT NULL
 )
 /
 update GCD.DAILY_ACCRUAL_VIRTUS_STAG set asofdate=trunc(sysdate, 'dd')
 /
 alter table GCD.DAILY_ACCRUAL_VIRTUS_STAG modify
 (
     ASOFDATE        NOT NULL
 )
 /

举报

相关推荐

0 条评论