Hi everyone,
using some ETL tool i am migrating data into oracle database tables here i am not using oracle sequence. after migration i have to reset the sequence.
ex: table: employee, sequence name : employee_id_seq
initially :
create sequence employee_id_seq
start with 1 increment by 1;
employee table data:
employee_id ename
-------- ---------
1 aa
5 bb
6 cc
to reset sequence i am dropping that sequence and recreating the sequence
ie.,
drop sequence employee_id_seq;
here max(employee_id) is 6 hence nextvalue is 7 .
create sequence employee_id_seq
start with 7 increment by 1;
select employee_id_seq.nextval from dual;
nextval:
--------
7
instead of drop and recreate sequence any other method is there to reset the sequence.so, that i will create a dynamic script that will reset all sequences.
please advise on this.
Thanks,
karteek