create public database link ora
connect to system identified by manager
using 's-server';
create or replace trigger tg_e_contact
before update or insert or delete on e_contact
for each row
begin
if inserting then
insert into [email protected]
values
(:new.telephone, :new.employeeid, :new.status);
else
if updating then
update [email protected] s
set s.telephone = :new.telephone,
s.employeeid = :new.employeeid,
s.status = :new.status
where s.employeeid = :old.employeeid;
else
if deleting then
delete from [email protected] s
where s.employeeid = :old.employeeid;
end if;
end if;
end if;
end;
create or replace trigger tg_e_contact
before instead of update or instead of insert or instead of delete on e_contact
for each row
begin
if inserting then
insert into [email protected]
values
(:new.telephone, :new.employeeid, :new.status);
else
if updating then
update [email protected] s
set s.telephone = :new.telephone,
s.employeeid = :new.employeeid,
s.status = :new.status
where s.employeeid = :old.employeeid;
else
if deleting then
delete from [email protected] s
where s.employeeid = :old.employeeid;
end if;
end if;
end if;
end;
新闻热点
疑难解答