当与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