create or replace trigger JCJ441_trg after insert or delete or update on JCJ441 for each row
DECLARE
gxbz varchar2(10);
jldwtj varchar2(100);
tmp number;
begin
if INSERTING then
gxbz := 'insert';
jldwtj := 'xxdm=''' || :new.xxdm || '''';
end if;
if DELETING then
gxbz := 'delete';
jldwtj := 'xxdm=''' || :old.xxdm || '''';
end if;
if UPDATING then
gxbz := 'update';
jldwtj := 'xxdm=''' || :old.xxdm || '''';
end if;
if INSERTING then
jldwtj := jldwtj || ' and bh=''' || :new.bh || '''';
else
jldwtj := jldwtj || ' and bh=''' || :old.bh || '''';
end if;
insert into tbgx(bm, jldwtj, gxbz, scsj)
values('JCJ441', jldwtj, gxbz, sysdate);
exception
when others then
null;
end;
/
DECLARE
gxbz varchar2(10);
jldwtj varchar2(100);
tmp number;
begin
if INSERTING then
gxbz := 'insert';
jldwtj := 'xxdm=''' || :new.xxdm || '''';
end if;
if DELETING then
gxbz := 'delete';
jldwtj := 'xxdm=''' || :old.xxdm || '''';
end if;
if UPDATING then
gxbz := 'update';
jldwtj := 'xxdm=''' || :old.xxdm || '''';
end if;
if INSERTING then
jldwtj := jldwtj || ' and bh=''' || :new.bh || '''';
else
jldwtj := jldwtj || ' and bh=''' || :old.bh || '''';
end if;
insert into tbgx(bm, jldwtj, gxbz, scsj)
values('JCJ441', jldwtj, gxbz, sysdate);
exception
when others then
null;
end;
/