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

ITTRANSPORT_SET_BUH_QUALITY

 

Описание

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

 

Определение

CREATE TRIGGER ITTRANSPORT_SET_BUH_QUALITY FOR ITTRANSPORT
ACTIVE AFTER INSERT OR UPDATE POSITION 0
as
declare ISLAB integer;

begin
  if (new.SENDERQUALITYID is not null) then begin
    select QUALITYDATA.QUALITYVALUE
      from QUALITYDATA
      where (QUALITYDATA.QUALITYID = new.SENDERQUALITYID)
        and (QUALITYDATA.QUALITYTYPEID = 200)
    into :ISLAB;

    if (:ISLAB = 1) then begin
      update IT
      set IT.BUHQUALITYID = new.SENDERQUALITYID
      where (IT.INVENTORYID = new.INVENTORYID);
    end

    if (:ISLAB = 0) then begin
      update IT
      set IT.BUHQUALITYID = IT.LABQUALITYID
      where (IT.INVENTORYID = new.INVENTORYID);
    end

  end
end

 

     Previous topic Chapter index Next topic