Oracle修改字段属性


/*修改原字段名name为name_tmp*/
alter table T_XZCF_NEW_DELETE rename column CF_NR_FK to CF_NR_FK_tmp;

/*增加一个和原字段名同名的字段name*/
alter table T_XZCF_NEW_DELETE add CF_NR_FK NUMBER(13,6);

/*将原字段name_tmp数据更新到增加的字段name*/
update T_XZCF_NEW_DELETE set CF_NR_FK=trim(CF_NR_FK_tmp);

/*更新完,删除原字段name_tmp*/
alter table T_XZCF_NEW_DELETE drop column CF_NR_FK_tmp;

 

你可能感兴趣的:(数据库)