當與PARTITION BY REFERENCE一起使用時,是否可以將ON DELETE CASCADE添加到用作分區鍵的外鍵?我正在談論一個已經退出的桌子。Oracle:通過引用將ON DELETE CASCADE添加到分區中使用的外鍵
我的解決方案是刪除約束並重新創建它,但它不起作用,因爲我無法刪除由PARTITION BY REFERENCE使用的約束。
我得到 SQL錯誤:ORA-14650:不支持參考分區表
的Oracle 11g操作。
drop table y;
drop table x;
create table x (a number primary key) partition by hash (a);
create table y (a number not null,
constraint y_x_fk foreign key(a) references x(a))
partition by reference(y_x_fk);
alter table y drop constraint y_x_fk;
東西我沒有變:你想將y_x_fk約束更改爲刪除級聯?你說你不能刪除它?你確定? –
是的,我試圖刪除約束時得到了ORA-14650。該表通過引用進行分區,並且此FK是分區鍵,您不能只放棄這樣的約束。 – rattaman