还是用TRIGGEREVENT 好.
假设 表1 test_a(a,b,c),表2 test_b(e,f,g) 设test_a.a为primary key
create or replace trigger TRI_UPDATE_TEST_A
after UPDATE on test_a
for each row
declare
l_exist number:=0;
begin
if updating then
select count(*)
into l_exist
from test_b
where e=:old.a;
if l_exist<1 then
insert into test_b(:new.a ,:new.b,:new.e);
end if;
end if;
end TRI_UPDATE_TEST_A;
假设 表1 test_a(a,b,c),表2 test_b(e,f,g) 设test_a.a为primary key
create or replace trigger TRI_UPDATE_TEST_A
after UPDATE on test_a
for each row
declare
l_exist number:=0;
begin
if updating then
select count(*)
into l_exist
from test_b
where e=:old.a;
if l_exist<1 then
insert into test_b(:new.a ,:new.b,:new.e);
end if;
end if;
end TRI_UPDATE_TEST_A;
before delete on ar_location_rates
begin
insert table_name ( ,,, ) values (,,,,) where 条件
end;
before update on a
for each row
begin
insert into b (...) values (:new.col);
end;
/