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

DEVIATION_CHANGESTATE

 

Описание

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

 

Определение

CREATE TRIGGER DEVIATION_CHANGESTATE FOR DEVIATION
ACTIVE BEFORE UPDATE POSITION 0
as
begin
  if (new.PERMITUSERID is not null) then begin
    new.DEVIATIONSTATE = 1;
    new.PERMITDATETIME = current_timestamp;
  end

  if (new.CONFIRMUSERID is not null) then begin
    new.DEVIATIONSTATE = 2;
    new.CONFIRMDATETIME = current_timestamp;

    if (old.PERMITUSERID is null) then begin
      new.PERMITUSERID = new.CONFIRMUSERID;
      new.PERMITDATETIME = new.CONFIRMDATETIME;
    end
  end
end

 

     Previous topic Chapter index Next topic