假设 表 A 的字段comment 原来的类型为CLOB现要改成 varchar2(2000),用语句: 
alter table A modify comment nvarchar2(2000)
执行时出错 :ORA-22859  invalid modification of columns请问大家怎样改此字段的类型啊?

解决方案 »

  1.   

    是不是comment字段有数据啊?
    需要清除数据,再修改吧
      

  2.   

    觉得是comment里有超过2000字符的数据
      

  3.   

    用:alter table A modify comment nvarchar2(10)也是同样的错误
      

  4.   

    把clob 改为nvarchar2 直接肯定是行的 数据类型只有小转大 而你是把大范围改为小的 肯定不行的
    有点小麻烦
      

  5.   

    既然没有数据就直接这样
    alter table a drop column comment;

    alter table a add comment nvarchar2(2000)
      

  6.   

    7 楼的有个疑问  这样弄了 字段的顺序会变哦 
    ?这样可以不 创建一个  只有一个字段 CLOB 的表  b
    然后 
    用 你原来的表 和 clob 表 
    create table a_2 as 
    select .....   --这里的顺序是A表里的所以字段 A的 comment  字段改成B 的clob 字段 
    from A ,  b where 1 > 2