I'm having trouble running this piece of code. It says that the trigger was created with compilation errors but does not explain what's wrong and does not give any output. Below is the code and the error I'm given. I'm on Oracle 11g R1 and am using PL/SQL.
CREATE OR REPLACE TRIGGER checkRecommendedAge
BEFORE INSERT OR UPDATE ON Loan
FOR EACH ROW
DECLARE
borAge number;
ex exception;
BEGIN
SELECT count(*) INTO borAge
FROM Loan
WHERE dateOut =: new.dateOut;
IF borAge < 18 THEN
dbms.output.put_line('Row added to Book table succesful');
ELSE
raise ex;
END IF;
EXCEPTION
WHEN EX THEN
raise_application_error("Error");
END;
/
Error:
Warning: Trigger created with compilation errors.
SQL> SHOW ERRORS
Errors for TRIGGER CHECKRECOMMENDEDAGE:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PLS-00801: internal error [ph2csql_strdef_to_diana:bind]
6/2 PL/SQL: SQL Statement ignored
7/7 PL/SQL: ORA-06544: PL/SQL: internal error, arguments:
[ph2csql_strdef_to_diana:bind], [], [], [], [], [], [], []
10/3 PL/SQL: Statement ignored
10/3 PLS-00201: identifier 'DBMS.OUTPUT' must be declared
17/2 PL/SQL: Statement ignored
17/27 PLS-00201: identifier 'Error' must be declared
Any help would be appreciated
Thanks