触发器TRIGGER的编写与调试

来源:互联网 发布:云计算技术及应用 编辑:程序博客网 时间:2024/05/01 14:31

 三大事件(insert、update、delete)的触发管理,触发的位置(before、after、instead of)

现在我举例说明,本人要对支出表进行insert事件进行触发,且在insert之前

create or replace trigger datacheck
  before insert on outlay 
  for each row
declare

begin
        IF  0<1 THEN
               RAISE_APPLICATION_ERROR(-20001, 'Employees must at least eighteen years of age.');
        END IF;
end datacheck;

 

SQL> set serveroutput on;
SQL> @D:\trigger.sql
 11  /
ORA-20001: Employees must at least eighteen years of age.
ORA-06512: 在
"PSFMS.MINIMUN_AGE_CHECK", line 5
ORA-04088: 触发器 'PSFMS.MINIMUN_AGE_CHECK'
执行过程中出错

PL/SQL 过程已成功完成。

 

 

原创粉丝点击