2013-07-10 123 views
1

我有我的PLSQL块如下:甲骨文PLSQL ORA-39726错误

DECLARE 
CURSOR cdrimei IS select distinct(table_name) as tname from user_tab_columns 
where column_name = 'CALLED_NUMBER_TIPO_ABONADO' and table_name not like '%_V' order by table_name; 
BEGIN 
FOR i in cdrimei 
LOOP 

execute immediate 'ALTER TABLE '||i.tname||' DROP (IMEI_CHAIN ,IMEI_STOLEN)'; 
execute immediate 'ALTER TABLE '||i.tname||' ADD (IMEI_CHAIN varchar2(255),IMEI_STOLEN varchar2(255))'; 

END LOOP; 
END; 
/

执行此我对着下面的错误后:

ORA-39726: unsupported add/drop column operation on compressed tables 

我不明白的压缩的意义表。

回答

2

压缩的表必须在Administrator's Guide记录了一些限制:

The following restrictions apply when adding columns to compressed tables:

  • Basic compression—You cannot specify a default value for an added column.

  • OLTP compression—If a default value is specified for an added column, then the column must be NOT NULL. Added nullable columns with default values are not supported.

The following restrictions apply when dropping columns in compressed tables:

  • Basic compression—Dropping a column is not supported.

  • OLTP compression—DROP COLUMN is supported, but internally the database sets the column UNUSED to avoid long-running decompression and recompression operations.

+0

非常感谢马可。但是,有什么方法可以添加/删除列,因为我需要查询大约50个表。 – kattashri

+0

由于您没有指定默认值,所以'ADD'语句应该可以工作。 您可以尝试使用'SET UNUSED',而不是'DROP'。 –