您的位置:首页 > 其它

nc修改表字段

2015-08-07 17:13 393 查看

备份式修改:

--修改原字段名def1为def1_tmp

alter table srmsm_supplierext_p rename column def1 to def1_tmp;

--增加一个和原字段名同名的字段def1

alter table srmsm_supplierext_p add def1 varchar(4000);

--将原字段def1_tmp数据更新到增加的字段def1

update srmsm_supplierext_p set def1=trim(def1_tmp);

--更新完,删除原字段def1_tmp

alter table srmsm_supplierext_p drop column def1_tmp;



非备份式修改:

alter table fa_transasset_b modify(def1 varchar2(500));

commit;

update md_column t set t.columnlength=500

where t.tableid='fa_transasset_b' and t.name='def1';

commit;

update md_property t set t.attrlength =500

where t.classid in

(select c.id from md_class c

where c.defaulttablename='fa_transasset_b') and t.name='def1';

commit;

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: