Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: how to update a sequence?
Hi Norbert,
You can't do it the way you're suggesting as far as I know..nor can you alter the 'START WITH' value of the sequence to have it start at the higher number....
Your best bet may be to drop the sequence and recreate it in your code and set the START WITH value to the number you want your inserts to start at.
Hope this helps,
Steve
Norbert Lemke wrote:
> Hi,
>
> I have an oracle sequence, it generates unique keys (everything all right so
> far). With my Visual-Basic-GUI I can create single records 'insert into tab
> (id) values(seq.nextval)', and everything works fine.
>
> But now I want to insert some bulk data, 10,000 records at once. I want to
> do this wiht the SAS-software, which has an own data format and own method
> for appending records.
>
> First I read the next free sequence number (say 120,001), and since I know
> the number of new records (10,000) I want to update the sequence to 130,000
> at once. Thereafter I can insert all records without any trouble. How can
> this be done? Is tere a method like 'update seq set currval=130000'?
>
> Thanks,
> Norbert
Received on Tue Jun 26 2001 - 11:06:13 CDT