CREATE OR REPLACE VIEW empvu20
AS SELECT *
FROM employees WHERE department_id = 20
WITH CHECK OPTION CONSTRAINT empvu20_ck ;
ياريت يا جماعه حد يفهمنى ايه فايدة
WITH CHECK OPTION CONSTRAINT empvu20_ck
وجزاكم الله كل خير
تاريخ المشاركة 07 October 2008 - 01:44 PM
تاريخ المشاركة 07 October 2008 - 11:46 PM
CREATE OR REPLACE VIEW ns as select ename,sal from emp where deptno=(
select deptno from dept where dname='ACCOUNTING')
/
----View created.
insert into ns values('ASD',1234);
--- 1 row created.
--
---- you will see now the new values.
select * from emp;
--
rollback;
----------------------------------------------
CREATE OR REPLACE VIEW ns as select ename,sal from emp where deptno=(
select deptno from dept where dname='ACCOUNTING')
with check option
/
----View created.
insert into ns values('ASD',1234);
----ORA-01402: view WITH CHECK OPTION where-clause violation
--- no new values inserted due to the ( WITH CHECK OPTION )