Robert Wehofer wrote:
Quote:
How could I refresh a sequence in Oracle using an SQL statement?
I've got the problem, that the current number of a sequence is less
the
highest index in a table, where I want to use the sequence.
Regards,
Robert |
Either drop and recreate OR
declare
max_value_ number := <max value to increment to>;
currval_ number;
nextval_ number;
begin
loop
select your_seq.currval into currval_ from dual;
if (currval_ >= max_value_) then
exit;
else
select your_seq.nextval into nextval_ from dual;
end if;
end loop;
end;
/
Regards
/Rauf