CREATE TRIGGER TTBPDV_CFE_B09I FOR TBPDV_CFE
ACTIVE BEFORE INSERT POSITION 9
AS
DECLARE VARIABLE HISTORICO VARCHAR(500);
BEGIN
  /* TRIGGER TEXT */

  HISTORICO = '';

  IF(NEW.ID > 0) THEN
  BEGIN
    HISTORICO = HISTORICO||'REGISTRO INCLUIDO';
  END

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