The trigger needs to stop a death date before the birthdate being entered.
CREATE TRIGGER Check_deathDate
BEFORE INSERT Or UPDATE of deathDate on Actor
FOR EACH ROW
DECLARE
deathDate DATE;
birthDate DATE;
deathDate_Error EXCEPTION;
IF (deathDate < birthDate) THEN
RAISE deathDate_Error;
END IF;
EXCEPTION
WHEN deathDate_Error THEN
Raise_application_error( 'deathDate' || 'should be before' || 'birthDate');
END;);
gives error…
*
ERROR at line 3:
ORA-04079: invalid trigger specification
…how else can i specifiy the IF?
Something like this: