SET TERM ^ ;

CREATE trigger ttbregistro_orcamento_b01d for tbregistro_orcamento
active before delete position 0
AS
DECLARE VARIABLE HISTORICO VARCHAR(500);
BEGIN
    HISTORICO = '';

    IF(OLD.ID > 0) THEN
    BEGIN
        HISTORICO = 'REGISTRO EXCLÚIDO';
    END

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

SET TERM ; ^

