创建约束更改表无效
我必须修改现有的约束,以便它能够级联更新和删除。 为此,我首先删除了约束,并计划添加它(通过 ALTER TABLE),但这失败了。
当我提交下面的查询时,它给出错误“ORA-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;
知道它可能是什么吗?我是否忽略了什么?
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-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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Oracle 不支持外键中的
ON UPDATE CASCADE
。查看此问题以获取提示:如何在Oracle上使用“ON UPDATE CASCADE”创建外键?
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?
Oracle 不支持 UPDATE CASCADE。您需要通过触发器来管理它。
查看Oracle语句:
UPDATE CASCADE is not supported in Oracle. You will need to manage this via triggers.
Check Oracle statement: