SET TERM ^ ;

CREATE OR ALTER trigger ttbmodelo_atributo_b01d for tbmodelo_atributo
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('TBMODELO_ATRIBUTO', OLD.ID, HISTORICO);
    END
END


^

SET TERM ; ^

