这个触发器为什么总是出错?
现在有表table ( a0 char(3),a1 char(3),a2 char(3),a3 number);
表中以 a0,a1,a2为关键字,现打算实现将a3值该为1时,要求实现所有与该记录的a0,a1字段相同的记录的a3的值全被修改为1,当a3的值被修改为0时,所有与之相同的记录字段被修改为0 写触发器如下:
create or replace trigger tri_table
after update of a3 on table
for each row
begin
if :new.a3=1 then
update table set a3=1 where a0=:old.a0 and a1=:old.a1;
elsif :new.a3=0 then
update table set a3=0 where a0=:old.a0 and a1=:old.a1;
end if;
end;
/
系统总是提示带有编译错误,而且当执行时,系统提示table 的表结构被更改,trigger无效
请问针对这种错误应该如何修改触发器语句(而不是创建一个视图,当然视图很有效)
谢谢!!!