转载于http://ju.outofmemory.cn/entry/336032
在Oracle数据库中,将字段的Clob类型修改为VARCHAR2的方法的大致思路:
1、新增一个字段,类型为VARCHAR2
2、将字段类型Clob的列数据更新到新增的列
3、删除Clob列
4、将新增列名更改为原来的列名
具体操作示例如下:
--新增一个字段,类型为VARCHAR2
alter table t_demo add temp VARCHAR2(500);
--将字段类型Clob的列数据更新到新增的列
update t_demo set temp=CONTENT;
--删除Clob列
alter table t_demo drop column CONTENT;
--将新增列名更改为原来的列名
alter table t_demo rename column temp to CONTENT;