CREATE OR REPLACE TRIGGER t2
after update or delete
ON company1
for each row
BEGIN
Select user into username from dual;
if updating then
insert into company2 values(:new.no,:new.name,'update',username);
end if;
if deleting then
insert into company2 values(:old.no,:old.name,'delete',username);
end if;
END;
No comments:
Post a Comment