create or replace trigger TEST
after update of status on monitor for each row
Declare pattid number(30):=0;
begin
select patid into pattid from monitor where serial=:old.serial;
if :new.status = 2 then
update patient set linkmob4='是' where pat_id=pattid;
else
update patient set linkmob4='否' where pat_id=pattid;
end if;
end;提示出错,不能这么干.5555
after update of status on monitor for each row
Declare pattid number(30):=0;
begin
select patid into pattid from monitor where serial=:old.serial;
if :new.status = 2 then
update patient set linkmob4='是' where pat_id=pattid;
else
update patient set linkmob4='否' where pat_id=pattid;
end if;
end;提示出错,不能这么干.5555
create or replace trigger TEST
before update of status on monitor for each row
begin
if :new.status = 2 then
:new.linkmob4='是';
else
:new.linkmob4='否';
end if;
end;
create or replace trigger TEST
after update of status on monitor for each row
Declare pattid number(30):=0;
begin
update patient set linkmob4=decode(:new.status,2,'是','否') where pat_id=:new.patid;
end;
after update of status on monitor for each row
Declare pattid number(30):=0;
begin
if :new.status = 2 then
update patient set linkmob4='是' where pat_id=new.pattid;
else
update patient set linkmob4='否' where pat_id=new.pattid;
end if;
end;