SET TERM ^ ;

CREATE trigger ttblog_rfid_b02i for tblog_rfid
active before insert position 2
AS
BEGIN   
    IF(COALESCE(NEW.ESTABELECIMENTO_ID, 0) = 0) THEN
    BEGIN
        NEW.ESTABELECIMENTO_ID = 1;
    END
END
^

SET TERM ; ^

