SET TERM ^ ;

CREATE OR ALTER trigger ttbcategoria_laclofit_b01d for tbcategoria_laclofit
active before delete position 0
AS
   DECLARE VARIABLE HISTORICO VARCHAR(500);
BEGIN

    HISTORICO = '';

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

    IF (HISTORICO <> '') THEN
    BEGIN
        EXECUTE PROCEDURE SPI_HISTORICO('TBCATEGORIA_LACLOFIT',OLD.ID, HISTORICO);
    END
end
^

SET TERM ; ^

