CREATE TRIGGER TTBPDV_CFE_ITEM_B09D FOR TBPDV_CFE_ITEM
ACTIVE BEFORE DELETE POSITION 9
AS
DECLARE VARIABLE HISTORICO VARCHAR(500);
BEGIN
  /* TRIGGER TEXT */

  HISTORICO = '';

  IF(OLD.ID > 0) THEN
  BEGIN
    HISTORICO = HISTORICO||'ITEM '||OLD.SEQUENCIA||' EXCLUIDO';
  END

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