I created the below trigger using Oracle 11g (ver 4.1.4)
CREATE OR REPLACE TRIGGER VALIDATE_BDAY_TRIG
BEFORE INSERT ON EMPLOYEE_T
FOR EACH ROW
--DECLARE
--v_dob EMPLOYEE_T.EMPLOYEEBIRTHDATE%TYPE;
BEGIN
INSERT INTO
EMPLOYEE_T (EmployeeID, EmployeeName, EmployeeAddress, EmployeeCity, EmployeeState, EmployeeZip, EmployeeBirthDate, EmployeeDateHired, EmployeeSupervisor)
VALUES (14545-589, 'JAKE', 'PHILIPPINES', 'PHILIPPINES', 'ML', 1113, TO_DATE('11/13/1980', 'MM/DD/YYYY'), TO_DATE('05/27/2017', 'MM/DD/YYYY'), 456789);
DBMS_OUTPUT.PUT_LINE('DOB: ' || :NEW.EMPLOYEEBIRTHDATE);
END;
/
When I tried to execute it to check if my trigger is correct using the below query:
EXEC VALIDATE_BDAY_TRIG;
I've got the error message:
Error report -
ORA-06550: line 1, column 7:
PLS-00201: identifier 'VALIDATE_BDAY_TRIG' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
My objective is to display the date of birth of the new inserted record so I can use it and validate if the date of birth is valid or not.
Any idea?
Thank you!