3,491
社区成员
发帖
与我相关
我的任务
分享
"java"
create or replace trigger test02
after update on table1
for each row
when (new.status='f' or new.status = 'g')
declare
theTrigerTaskId table1.id%type;
begin
select id into theTrigerTaskId from table1 where task_id = :new.id;//这张表是通过task_id自关联的,我的逻辑就是想在新的任务状态发生改变时,改变老的那条任务状态
if :new.status = 'f' then
update table1 set status='c' where id = theTrigerTaskId;
elsif :new.status = 'g' then
update table1 set status='d' where id = theTrigerTaskId;
end if;
end test02;
create or replace trigger test02
after update on table1
for each row
when (new.status='f' or new.status = 'g')
declare
theTrigerTaskId table1.id%type;
begin
select id into theTrigerTaskId from table1 where task_id = :new.id;//这张表是通过task_id自关联的,我的逻辑就是想在新的任务状态发生改变时,改变老的那条任务状态if :new.status = 'f' then
update table1 set status='c' where id = theTrigerTaskId;
elsif :new.status = 'g' then
update table1 set status='d' where id = theTrigerTaskId;
end if;
end test02;