-
using sequence cause inserted rows not in order
Halu.. i wanna ask about inserted records using sequence. I created a seq for table t1. I insert 10 rows or record and the id (which is the pk) shows the records in order (1.2.3.4.5.6.7.8.9.10). Then i delete one of the record (where id=3). I inserted one record into table t1 but when i select back the id appeared to be not in order which is id=1,2,11,4,5,6,7,8,9,10. Why is this happening? Why the next record is inserted in the space of id=3 whihch i had deleted? And how to resolve this?
-
Read up on sequences (and inserts for that matter).
-
Re: using sequence cause inserted rows not in order
Originally posted by merah
Why is this happening?
coz u have not used order by
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
-
It's not a matter of sequences, what you are probably seeing is empty space being re-used inside the data block -- the "11" record has taken the empty slot left by the delete of the "3" record.
-
Thats right, the sequence is doing its job by incrementing the number by one.. The order in which you view the data has nothing to do with the sequence.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|