SQL 视图“WITH CASCADE CHECK OPTION”行为?
我找不到任何关于此的参考或文档。
CREATE VIEW view1 AS SELECT * FROM tbl WHERE x = 1;
CREATE VIEW view2 AS SELECT * FROM view1 WHERE y = 1 WITH CASCADE CHECK OPTION;
在 view2 上执行 UPDATE
/INSERT
时,条件子句是否为 x = 1 AND y = 1
?
I can't find any reference, or documentation on this.
CREATE VIEW view1 AS SELECT * FROM tbl WHERE x = 1;
CREATE VIEW view2 AS SELECT * FROM view1 WHERE y = 1 WITH CASCADE CHECK OPTION;
Does the condition clause read x = 1 AND y = 1
in case of UPDATE
/INSERT
on view2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,也许看看
WITH CASCADED检查选项,它是 示例
和
定义视图
看起来
WITH CASCADE
选项确实强制执行所有视图条件。OK, so maybe have a look at
WITH CASCADED CHECK OPTION and it's example
and
Defining Views
It would seem that the
WITH CASCADE
option does enforce all view criteria.“使用级联检查选项”选项通常与“可更新视图”一起使用。给定子句用于防止插入或更新行,但 select_statement 中的 WHERE 子句为 true 的行除外。
The option "With Cascade Check Option" is normally used with "Updatable Views". The given clause is used to prevent inserts or updates to rows except those for which the WHERE clause in the select_statement is true.