执行:alter table bosp_htjs_material_information modify taxrate number(16,3);
直接执行如果有数据会有报错:ORA-01440: column to be modified must be empty to decrease precision or scale
数据不是非常大的情况下解决办法:1.备份表数据,2.清空原表对应列 3.修改字段精度。4.同步更新数据值。5.截断备份的临时表并删除
--1.create table BOSP_HTJS_MATERIAL_BAK as select * from BOSP_HTJS_MATERIAL_INFORMATION;
select * from BOSP_HTJS_MATERIAL_BAK;
--2.update BOSP_HTJS_MATERIAL_INFORMATION MI set MI.Feed_NUM = null;
select * from BOSP_HTJS_MATERIAL_INFORMATION;
--3.alter table BOSP_HTJS_MATERIAL_INFORMATION modify Feed_NUM number(16,3);
--4.update BOSP_HTJS_MATERIAL_INFORMATION MI set MI.Feed_NUM = (
select MB.Feed_NUM from BOSP_HTJS_MATERIAL_BAK MB where MB.id = MI.id
);
--5.truncate table BOSP_HTJS_MATERIAL_BAK;drop table BOSP_HTJS_MATERIAL_BAK;
原文链接:https://www.f2er.com/oracle/209813.html