`

ORA-22858: invalid alteration of datatype(varchar2转化clob)

 
阅读更多

在11g下
--修改某字段类型   不能按照字段原来顺序(尤其是clob 与其他字段的转换)
alter table gsj_question add column_new varchar2(2000);
update gsj_question set  column_new=c_replycontent;
alter table gsj_question drop column c_replycontent;
alter table gsj_question rename column  column_new to c_replycontent;

--修改某字段类型   可以按照字段原来顺序(尤其是clob 与其他字段的转换)
--本例是 varchar2 转成 clob
alter table gsj_question  add cloumn_new clob;
update  gsj_question  set cloumn_new=c_replycontent,c_replycontent=null;
commit;
alter table gsj_question  modify c_replycontent  long;
alter table gsj_question  modify c_replycontent clob;
update gsj_question  set c_replycontent=cloumn_new,cloumn_new=null;
commit;
alter table  gsj_question  drop column cloumn_new;
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics