Trying to get Oracle to Get a date set it to year only and compare to a value inserted or updated into my database before hand This is what I have tried so far. But I seem to be stuck Any assistance would be great, Thanks
create or replace
TRIGGER CHECK_YEAR_DIFF
BEFORE INSERT OR UPDATE OF YEAROFPERSON ON PERSON
FOR EACH ROW
Currentdate Date;
Playeryrborn_Var Integer;
Begin
Currentdate := TRUNC(Sysdate,'YYYY');
YEAROFPERSON_var := new.YEAROFPERSON;
IF (currentDate - YEAROFPERSON_var <= 40) AND (currentDate - YEAROFPERSON_var => 16) THEN
dbms_Output.Put_Line('Year of Birth Updated Successfully');
ELSE
dbms_output.put_line('Year of Birth Failed to Successfully Update');
END IF;
END;