-
Hii,we are using sequenceno in table .
we have data 2000 rows,now problem is some rows are deleted,so now seqno's like 1,2,3,6,8 ---2000.
my question i need to reset the seqno(1-1800) becuase in between 200 rows are deleted.
how set the sequence values in order for rows.
thanks
kavitha
-
I cannot see any logical reason why you need to do that but here is what you can do.
1. Drop the sequence.
2. Recreate it like that:
Code:
CREATE SEQUENCE kavithared_seq
INCREMENT BY 1
START WITH 1
MINVALUE 1
MAXVALUE 9999999999999
NOCYCLE
NOORDER
CACHE 20;
3. Get all rows from the table within a cursor ordering the rows according to the old sequence number column (sid or whatever you have called it), open it, fetch the first row and update the sid using the newly formed sequence, fetch the second one, and so on in a loop while you have updated all rows. Remember to commit :-)
-
Plz let me know if the solution given by Julian works or not, I'll give you alternative...
Sandy
-
Hii,give me other solution
thanks