Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL to bump up a sequence.

Status
Not open for further replies.

urge262

MIS
Sep 27, 2004
13
US
I have a sequence on a table and I need to bump it up.

Secuence Name: SQ_SRVC_CT

the Last Value: 43

I need the last value changed to 1155 so that the next record will have an ID of 1156.

I tried: Alter sequence SQ_SRVC_CT next value 1155

but I get the error: ORA-02286: no options specified for ALTER SEQUENCE

Also tried: alter sequence SQ_SRVC_CT lastvalue 1155 ORA-02286: no options specified for ALTER SEQUENCE
 
I think your best bet is to drop and recreate the sequence using the "START WITH 1155" option.
 
How would I go about doing that. Just learing about sequences

Thanks
 
DROP SEQUENCE my_sequence;
CREATE SEQUENCE my_sequence START WITH 1155;

Of course, before you drop the sequence, you'll probably want to check out what the other parameters are set to so you can recreate the sequence correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top