2 回答

TA貢獻1853條經(jīng)驗 獲得超9個贊
create or replace trigger trigger_temp after update
on TableB
as
begin
DECLARE @realdate_old date,@realdate _new date
SELECT @realdate_old=realdate from deleted ----獲取修改前的
SELECT @realdate_new =realdate FROM inserted
if(:@realdate_new< @realdate _old) then
begin
update TableA a set a.type = 10 where a.id = @realdate_new;
end;
end if;
end trigger_temp;

TA貢獻1785條經(jīng)驗 獲得超4個贊
create or replace trigger trigger_temp after update
on TableB
FOR EACH ROW
begin
if(:new.realdate < old.realdate ) then
begin
update TableA a set a.type = 10 where a.id = :new.Fid;
end;
end if;
end trigger_temp;
- 2 回答
- 0 關(guān)注
- 148 瀏覽
添加回答
舉報