I'm trying to clean up some triggers on our database by using "WHEN" statements and am having trouble with those requiring "WHEN INSERTING OR UPDATING". The code below is generating an ORA-00920 Invalid relational operator error.
Create or Replace Trigger Validate_EMP_T1 on EMP
After Insert OR Update
On EMP For Each Row
WHEN ( UPDATING AND ( NEW.salary != OLD.salary
OR NEW.dept_no != OLD.dept_no )
OR INSERTING AND NEW.salary != 0 )
BEGIN
IF UPDATING THEN
code...
ELSIF INSERTING THEN
code...
END IF;
END;
Thanks for any help,
geerae
Create or Replace Trigger Validate_EMP_T1 on EMP
After Insert OR Update
On EMP For Each Row
WHEN ( UPDATING AND ( NEW.salary != OLD.salary
OR NEW.dept_no != OLD.dept_no )
OR INSERTING AND NEW.salary != 0 )
BEGIN
IF UPDATING THEN
code...
ELSIF INSERTING THEN
code...
END IF;
END;
Thanks for any help,
geerae