declare
LastValue integer;
begin
loop
select FORUM_AUTO_SQ.currval into LastValue from dual;
exit when LastValue >= new_nextval - 1;
select FORUM_AUTO_SQ.nextval into LastValue from dual;
end loop;
end;
/