开发者

Create constraint alter table invalid

I had to modify an existing constraint so it would cascade updates and deletes. To do this I first removed the constraint and was planning on adding it (through an ALTER TABLE) but this fails.

When I commit the query below it gives me the error 'ORA开发者_JS百科-01735: invalid ALTER TABLE option':

ALTER TABLE 
    PARAM 
ADD CONSTRAINT 
    FK_PARAM_PORTLET FOREIGN KEY (PORTLETID) 
REFERENCES PORTLET(ID) 
ON DELETE CASCADE ON UPDATE CASCADE;

Any idea what it could be? Am I overlooking something?


Oracle does not support ON UPDATE CASCADE in foreign keys.

Have a look at this question for tips: How to create a Foreign Key with "ON UPDATE CASCADE" on Oracle?


UPDATE CASCADE is not supported in Oracle. You will need to manage this via triggers.

Check Oracle statement:

Referential integrity constraints can specify particular actions to be performed on the dependent rows in a child table if a referenced parent key value is modified. The referential actions supported by the FOREIGN KEY integrity constraints of Oracle are UPDATE and DELETE NO ACTION, and DELETE CASCADE.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜