p***@yahoo.com
2006-11-14 10:34:49 UTC
i need the record to be deleted from XORDERS table when an ORDER_ID gets deleted from ORDERS table.
But when I execute the query,i face an exception.
create table XORDERS (
ORDERS_ID BIGINT NOT NULL ,
ACCOUNT_ID BIGINT NOT NULL references ACCOUNT(ACCOUNT_ID),
constraint XORDERS_F1 foreign key (ORDERS_ID) references ORDERS (ORDERS_ID) on delete cascade);
SQL Exception: Foreign Key 'XORDERS_F1' is invalid because 'the delete rule of foreign key must be NO ACTION. (The relationship would cause the table to be delete-connected to the same table through multiple relationships and such relationships must have the same delete rule (NO ACTION, RESTRICT or CASCADE).) '.
I tried with NO ACTION.It works.But that doesnt satisfy my requirement.
Plz help me out.
But when I execute the query,i face an exception.
create table XORDERS (
ORDERS_ID BIGINT NOT NULL ,
ACCOUNT_ID BIGINT NOT NULL references ACCOUNT(ACCOUNT_ID),
constraint XORDERS_F1 foreign key (ORDERS_ID) references ORDERS (ORDERS_ID) on delete cascade);
SQL Exception: Foreign Key 'XORDERS_F1' is invalid because 'the delete rule of foreign key must be NO ACTION. (The relationship would cause the table to be delete-connected to the same table through multiple relationships and such relationships must have the same delete rule (NO ACTION, RESTRICT or CASCADE).) '.
I tried with NO ACTION.It works.But that doesnt satisfy my requirement.
Plz help me out.