Nested view definitions
If a view is based on another view, the number of predicates that must be evaluated is based on the WITH CHECK OPTION specification.
If a view is defined without WITH CHECK OPTION, the definition of the view is not used in the data validity checking of any insert or update operations. However, if the view directly or indirectly depends on another view defined with the WITH CHECK OPTION, the definition of that super view is used in the checking of any insert or update operation.
If a view is defined with the WITH CASCADED CHECK OPTION or just the WITH CHECK OPTION (CASCADED is the default value of the WITH CHECK OPTION), the definition of the view is used in the checking of any insert or update operations. In addition, the view inherits the search conditions from any updatable views on which the view depends. These conditions are inherited even if those views do not include the WITH CHECK OPTION. Then the inherited conditions are multiplied together to conform to a constraint that is applied for any insert or update operations for the view or any views depending on the view.
CREATE VIEW EMP_VIEW2 AS
SELECT EMPNO, EMPNAME, DEPTNO FROM EMP
WHERE DEPTNO = 10
WITH CHECK OPTION;
CREATE VIEW EMP_VIEW3 AS
SELECT EMPNO, EMPNAME, DEPTNO FROM EMP_VIEW2
WHERE EMPNO > 20
WITH CASCADED CHECK OPTION;
The WITH LOCAL CHECK OPTION can also be specified when creating a view. If a view is defined with the LOCAL CHECK OPTION, the definition of the view is used in the checking of any insert or update operations. However, the view does not inherit the search conditions from any updatable views on which it depends.