SET TERM ^ ;

CREATE trigger ttbtransacao_pix_b02i for tbtransacao_pix
active before insert position 9
AS
declare variable HISTORICO VARCHAR(500);
begin
    HISTORICO = '';

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

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

SET TERM ; ^

