When you make an update to an element_rank field (ELEMENT_GLOBAL.g_rank, ELEMENT_NATIONAL.n_rank, ELEMENT_SUBNATIONAL.s_rank) via a SQL update statement, you must be sure an update the rounded rank as well. When you make updates through the GUI, Biotics uses a stored procedure to update the rounded rank. When you update a rank through SQL, you are bypassing this step. There is a function that you can use in SQL updates that will re-round the rank for you, but they must explicitly code that into the update statement. It won't be done automatically for you. So you'd want to do something like this:

update element_global
set g_rank = 'G4',
rounded_g_rank = round_grank('G4'),
rec_last_mod_user = 'carol'
where etc. etc.

or something like this:

update element_global
set g_rank = 'G4',
rec_last_mod_user = 'carol'
where etc. etc.
commit;


followed by:

update element_global
set rounded_g_rank = round_grank(g_rank),
rec_last_mod_user = 'carol'
where etc. etc.


You can't update both fields in the same statement, unless you hard-code the rank in the round_grank function. In other words, this won't work:

update element_global
set g_rank = 'G4',
rounded_g_rank = round_grank(g_rank),
rec_last_mod_user = 'carol'
where etc. etc.


Since the update to the g_rank field hasn't been committed yet, the round_grank function will simply reround the OLD rank.

There is also the round_nrank and round_srank functions that work the same way.