I have created a view using 'emp' and 'dept' table.
create or replace view view_test (emp_name,dept_name,location) as
select e.emp_name,d.dept_name,d.location from emp e,dept d
where e.DEPT_NO=d.DEPT_NO;
And an 'INSTEAD OF' trigger:
CREATE OR REPLACE TRIGGER TRIG_TEST
INSTEAD OF UPDATE ON VIEW_TEST
FOR EACH ROW
BEGIN
UPDATE VIEW_TEST
SET LOCATION=:NEW.LOCATION
WHERE DEPT_NAME=OLD.DEPT_NAME;
END;
/
When I am trying to update the value in VIEW_TEST, I am getting the below error:
update view_test
set location ='ASIA'
WHERE DEPT_NAME='HR';
ORA-00036: maximum number of recursive SQL levels (50) exceeded
Can anyone please help me..
Thanks in Advance!!
VIEW_TESTthen tries to updateVIEW_TEST, resulting in an infinite recursion of updates. I suspect you wanted to updateDEPTrather thanVIEW_TEST?