大家好,我创建触发器时出现编译错误,但又找不到是哪里的问题,想实现的功能就是当对worker表增、删、改时,将用户、时间和操作类型保存到tr_log表中,代码如下:
SQL> create or replace trigger tr_1
2 after insert or delete or update on worker
3 begin
4 if inserting then
5 insert into tr_log values(user,sysdate,'I');
6 elsif deleteing then
7 insert into tr_log values(user,sysdate,'D');
8 else
9 insert into tr_log values(user,sysdate,'U');
10 end if;
11 end;
12 /Warning: Trigger created with compilation errorsSQL> show error;
Errors for TRIGGER ZHENJIANG.TR_1:LINE/COL ERROR
-------- -------------------------------------
4/7 PLS-00201: 必须声明标识符 'DELETEING'
2/1 PL/SQL: Statement ignoredSQL>
SQL> create or replace trigger tr_1
2 after insert or delete or update on worker
3 begin
4 if inserting then
5 insert into tr_log values(user,sysdate,'I');
6 elsif deleteing then
7 insert into tr_log values(user,sysdate,'D');
8 else
9 insert into tr_log values(user,sysdate,'U');
10 end if;
11 end;
12 /Warning: Trigger created with compilation errorsSQL> show error;
Errors for TRIGGER ZHENJIANG.TR_1:LINE/COL ERROR
-------- -------------------------------------
4/7 PLS-00201: 必须声明标识符 'DELETEING'
2/1 PL/SQL: Statement ignoredSQL>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货