作者:手机用户2502932023 | 来源:互联网 | 2014-07-13 17:52
oracle-修改字段类型例子:l_amount_temp是临时字段,L_AMOUNT是要修改的字段.Sql代码altertableLAW_LITIGATION_CASEaddl_amount_tempint;www.2cto.comaltertableLAW_LITIGATIO...
oracle-修改字段类型
例子:l_amount_temp是临时字段, L_AMOUNT是要修改的字段.
Sql代码
alter table LAW_LITIGATION_CASE add l_amount_temp int;
www.2cto.com
alter table LAW_LITIGATION_CASE modify L_AMOUNT NULL;
update LAW_LITIGATION_CASE set l_amount_temp=L_AMOUNT,L_AMOUNT=NULL;
commit;
alter table LAW_LITIGATION_CASE modify L_AMOUNT float(24);
update LAW_LITIGATION_CASE set L_AMOUNT= l_amount_temp, l_amount_temp=NULL;
commit;
alter table LAW_LITIGATION_CASE drop column l_amount_temp;
alter table LAW_LITIGATION_CASE modify L_AMOUNT NOT NULL;
作者 czpae86