SET TERM ^ ;

CREATE trigger ttbavaliacao_des_resp_b02i for tbavaliacao_des_resposta
active before insert position 1
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('TBAVALIACAO_DES_RESPOSTA', NEW.ID, HISTORICO);
    END
END
^

SET TERM ; ^

