当前位置:操作系统 > Unix/Linux >>

ora-01440:column to be modified must be empty to decrease precision or scale解决

ora-01440:column to be modified must be empty to decrease precision or scale解决
 
问题缘由:
   客户要求某个字段支持小数点,数据库一开始设计的时候只支持整数,在通过alert语句修改类型,出现了ora-001440的错误,
 
解决办法
   step1:备份原来的表,
create table WF_TEACHER_REMUNERATION_BAK
    as select * from WF_TEACHER_REMUNERATION;
 
step2:删除原来表的数据
delete  from 
WF_TEACHER_REMUNERATION
;
step3:修改精度
ALTER TABLE "DHOFFICE"."WF_TEACHER_REMUNERATION"
MODIFY ( "CLASS_TIME" NUMBER(10,2) ) ;
 
step4:恢复数据
insert into 
WF_TEACHER_REMUNERATION
 select * from 
WF_TEACHER_REMUNERATION_BAK
 
step by step  ,打完毕,收工!
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,