"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