2013-07-10 99 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'。 –