SET TERM ^ ;

CREATE OR ALTER trigger ttbcategoria_laclofit_b03i for tbcategoria_laclofit
active before insert position 3
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('TBCATEGORIA_LACLOFIT',NEW.ID, HISTORICO);
    END
end
^

SET TERM ; ^

