So basically i need to write a trigger for assuring that at all times, any star appearing in StarsIn also appears in MovieStar. I need to make the trigger for both insert and update events.
This is the statement i have so far
CREATE OR REPLACE TRIGGER movieTrigger AFTER UPDATE OR INSERT ON STARSIN FOR EACH ROW WHEN(new.STARNAME NOT IN(SELECT "NAME" FROM MOVIESTAR)) BEGIN INSERT INTO MOVIESTAR("NAME") VALUES(new.STARNAME) END;
and this is the error that i am getting
Error report: ORA-02251: subquery not allowed here 02251. 00000 - "subquery not allowed here" *Cause: Subquery is not allowed here in the statement. *Action: Remove the subquery from the statement.
I am not sure how to do this without the sub query. Any ideas?