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

IT_SETID

 

Описание

Установка ID

 

Определение

CREATE TRIGGER IT_SETID FOR IT
ACTIVE BEFORE INSERT POSITION 0
as

begin
  if (new.INVENTORYID is null) then
    new.INVENTORYID = gen_id(INVENTORYIDGEN,1);
/*  IF (NEW.WEIGHTNUMBER IS NULL) THEN
    NEW.WEIGHTNUMBER = GEN_ID(WEIGHTNUMBERGEN,1);*/

  if (new.STATE is null) then
    new.STATE = 0;

  if (new.PARENTID is null) then
    new.PARENTID = 0;
end

 

     Previous topic Chapter index Next topic