Oracle
Using the WITH CHECK OPTION Clause
Figo Kim
2006. 11. 24. 17:03
CREATE OR REPLACE VIEW empvu20
AS
SELECT *
FROM employees WHERE department_id = 20
WITH CHECK OPTION CONSTRAINT empvu20_ck;
AS
SELECT *
FROM employees WHERE department_id = 20
WITH CHECK OPTION CONSTRAINT empvu20_ck;
No rows are updated because if the department number were to change to 10, the view would no longer be able to see that employee. With the WITH CHECK OPTION clause, therefore, the view can see only employees in department 20 and doesn't allow the department number for those employees to be changed through the view.