这个触发器,不知道为什么出错,急
表名为da
数据为: id xh
212 1
343 2
433 3
542 4
触发器功能为:删除记录后,表中xh保持连续。
我的代码为:
create or replace trigger da_delete
after delete on da
for each row
begin
update da set xh=xh-1 where id=:old.id and xh>:old.xh;
end da_delete;
代码编译通过,但我删除一条记录时,触发器报错。错误语句就是那条update语句。
我找不到错误原因,请高手指点,多谢。