我在运行这段代码时遇到了问题。它说触发器是用编译错误创建的,但没有解释错误所在,也没有给出任何输出。下面是我得到的代码和错误。我使用的是Oracle11gSQL,使用的是PL/ R1。
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');
raise ex;
END IF;
EXCEPTION
WHEN EX THEN
raise_application_error("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: