|
|
|
|
|
|
| Author |
Message |
Rauf Sarwar *nix forums Guru
Joined: 03 May 2005
Posts: 353
|
Posted: Wed Feb 23, 2005 8:49 am Post subject:
Re: how to refresh a sequence
|
|
|
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 |
|
| Back to top |
|
 |
Robert Wehofer *nix forums beginner
Joined: 08 Feb 2005
Posts: 31
|
Posted: Wed Feb 23, 2005 7:51 am Post subject:
how to refresh a sequence
|
|
|
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 |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 6:06 am | All times are GMT
|
|
Loans | Debt Consolidation | Bankruptcy | Prepaid Credit Cards | Buy Anything On eBay
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|