Sequence Creation and Resetting

Creating a sequence is easy

create sequence IDM.PERSON_SEQ start with 1 increment by 1

Now, you can 

select IDM.PERSON_SEQ.nextval from dual;

You can't reset a sequence, only drop and recreate

select max(MD_PERSON_KEY) from IDM.MD_PERSONS --this is an example of getting your highest used number
drop sequence IDM.PERSON_SEQ
create sequence IDM.PERSON_SEQ start with 799425 increment by 1


Comments