sometimes in DB refresh , the rows are refreshed but corresponding sequences are not refreshed. and the difference may be as huge as 2000-3000. So how can we update the Sequence ?
- Can use alter sequence : to modify start value ( not good as different environments will have different definitions)
- can write a small java program that selects nextVal from sequence in a for loop 2k-3k
- Else can use this
select level, sequence.NEXTVAL from dual connect by level <= (select max(pk) from tbl);
No comments:
Post a Comment