Updating nextval in sequence in oracle


CREATE SEQUENCE gokhan.sample_seq START WITH 1000; SELECT last_number FROM user_sequences WHERE sequence_name = 'SAMPLE_SEQ'; LAST_NUMBER ----------- 1000 ALTER SEQUENCE gokhan.sample_seq INCREMENT BY -500; SELECT gokhan.sample_seq.The Oracle NEXTVAL function must be called before calling the CURRVAL function, or an error will be thrown.No current value exists for the sequence until the Oracle NEXVAL function has been called at least once.When the system comes back up, Oracle will cache new numbers from where it left off in the sequence, ignoring the so called "lost" sequence values.You can change the LASTVALUE for an Oracle sequence, by executing an ALTER SEQUENCE command.

Leave a Reply