"localhost:/firebird/data/ILICHEVSK2.FDB". Триггеры Previous topic Chapter index Next topic

SILAGE_CalcSilagePacksWeight

 

Описание

(Нет описания для триггера SILAGE_CalcSilagePacksWeight)

 

Определение

CREATE TRIGGER "SILAGE_CalcSilagePacksWeight" FOR SILAGE
ACTIVE AFTER UPDATE POSITION 2
AS
begin
  if (not(new.weight is null) and
      (((old.weight is null) and (new.weight <> 0)) or
       ((old.weight <> new.weight) and not(old.weight is null))))
  then
    update silagepacks
    set weight = (select sum(weight)
                    from silage
                    where silagepackid = old.silagepackid)
    where silagepackid = old.silagepackid;
END

 

     Previous topic Chapter index Next topic