Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Sequence numbers
Hi all,
I'm using an oracle sequence to generate unique numbers:
sequence.nextval gives me the next unique number.
The sequence caches 250 numbers and the increment is 1.
The question is whether it is possible to ask to oracle for the next 100
unique numbers in a single SQL call.
At the moment I'm using
SELECT sequence.nextval from dual;
to get the next number, however, this query is executed 20000 times.
Beforehand, I know that I need a lot of numbers anyway.
One way to do it is to set increment to 100, and than let the application handle the numbers in between. However, other applications are using the sequence as well, so I have to let the sequence number increment to 1.
Note that it is not necessary that all numbers generated by the sequence have to be consecutive.
Marcel
holstm_at_logica.com
Received on Wed May 14 1997 - 00:00:00 CDT