CREATE or replace TRIGGER t_table1_delete
after delete
ON table1
FOR each row
declare m_a1 char(32);/**/
begin
select max(a1) into m_a1 from table1 where gcbm=:old.gcbm;
if (m_a1 is not null) and (m_a1<>'') then
begin
update table2
set b1='good',
b2='是'
where gcbm=:old.gcbm;
end;
else
begin
update table2
set b1='ok',
b2='否'
where gcbm=:old.gcbm ;
end;
end if;
end;创建没有错误,当删除table1一行的数据时,出现错误:
ORA-04091 .............................
after delete
ON table1
FOR each row
declare m_a1 char(32);/**/
begin
select max(a1) into m_a1 from table1 where gcbm=:old.gcbm;
if (m_a1 is not null) and (m_a1<>'') then
begin
update table2
set b1='good',
b2='是'
where gcbm=:old.gcbm;
end;
else
begin
update table2
set b1='ok',
b2='否'
where gcbm=:old.gcbm ;
end;
end if;
end;创建没有错误,当删除table1一行的数据时,出现错误:
ORA-04091 .............................
Action Rewrite the trigger (or function) so it does not read that table.