Oracle数据库修改Number字段属性(表中存在数据的sql 代码)

--修改原字段名policyrebatepremium为policyrebatepremium_TMP
  alter table fht_policy_reconciliation rename column policyRebatePremium to policyRebatePremium_TMP;

--增加一个和原字段名同名的字段policyRebatePremium
  alter table fht_policy_reconciliation  add policyRebatePremium NUMBER(19,2);

 --将原字段policyRebatePremium_TMP数据更新到增加的字段policyRebatePremium
  update fht_policy_reconciliation set policyRebatePremium=trim(policyRebatePremium_TMP);

  --更新完,删除原字段policyRebatePremium_TMP
  alter table fht_policy_reconciliation drop column policyRebatePremium_TMP;

 

 

原文有bug、直接参考我这个就可以了

你可能感兴趣的:(oracle,数据笔记)