CREATE OR ALTER TRIGGER TTBCAIXABANCO_PREVISAO_B01I FOR TBCAIXABANCO_PREVISAO
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
    IF(NEW.CONTROLE IS NULL OR NEW.CONTROLE = 0) THEN
        NEW.CONTROLE = GEN_ID(GTBCAIXABANCO_PREVISAO, 1);
END;
