Oracle is modified from Varchar2 field type to Clob field type

1. In Oracle, if there is data stored in a single physical table, an error will be reported if the Varchar2 field is converted to the Clob field; it cannot be transferred.

2. The following methods can be used to transfer, the sample code is as follows:

--重命名要修改字段
alter table sys_param_configure rename column C_VALUE to C_VALUE_TEMP;
--新建一个该字段
alter table cos_sys_param_configure add C_VALUE clob;
--将之前的数据同步到新建字段中
update cos_sys_param_configure set C_VALUE=trim(C_VALUE_TEMP);
--删除无用字段
alter table cos_sys_param_configure drop column C_VALUE_TEMP;

 

Guess you like

Origin blog.csdn.net/joyksk/article/details/106077264