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

IT_SETSTORINGID

 

Описание

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

 

Определение

CREATE TRIGGER IT_SETSTORINGID FOR IT
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
begin
  if (new.OwnerID is not null) then
  begin
    if (exists (select * from clients where ClientID = new.OwnerID and isEnterprise = 1)) then
      new.StoringID = 7;
    else
      if (new.StoringID is null or new.StoringID = 7) then
        new.StoringID = 1;
  end
  else
     new.StoringID = null;
end

 

     Previous topic Chapter index Next topic