转自:https://blog.csdn.net/e_wsq/article/details/7561209
步骤:
1.建立一个临时varchar2字段用来保存数据
2.将clob的内容截取后更新到varchar2字段中
update table_wonder set tempcolumn = dbms_lob.substr(clobcolumn,4000);
3.drop掉clob字段
4.将临时varchar2字段改名
alter table table_wonder rename column tempcolumn to column;
另外rename语句在9.2以上版本支持,在pl/sql developer 7.0版本的command window中不支持,需要使用sqlplus。
列出lob类型不支持的sql语句
不支持的语句 | 不支持的用法例子 |
---|---|
select distinct |
select distinct clobcol from… |
select clause
order by |
select… order by clobcol |
select clause
group by |
select avg(num) from… group by clobcol |
union, intersect, minus
(note that union all works for lobs.) |
select clobcol1 from tab1 union select clobcol2 from tab2; |
join queries |
select… from… where tab1.clobcol = tab2.clobcol |
index columns |
create index clobindx on tab(clobcol)… |