CREATE OR ALTER trigger ttbcolaborador_descontos_b02i for tbcolaborador_descontos
active before insert position 0
AS
DECLARE VARIABLE HISTORICO VARCHAR(500);
BEGIN
  HISTORICO = '';
  IF(NEW.ID > 0) THEN
  BEGIN
    HISTORICO = HISTORICO||' REGISTRO INCLUIDO';
  END

  IF(HISTORICO <> '') THEN
  BEGIN
    EXECUTE PROCEDURE SPI_HISTORICO('TBCOLABORADOR_DESCONTOS',NEW.ID, HISTORICO);
  END
END;

