DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Oracle (http://www.daniweb.com/forums/forum129.html)
-   -   Deletion of Autonumber (http://www.daniweb.com/forums/thread160897.html)

amrita.r Dec 5th, 2008 12:50 pm
Deletion of Autonumber
 
I am doing a project using oracle10g XE and JSP.
Here i am using a table where data type of a field is autonumber.
It is working fine when i insert or update record. but it does not continue its sequence when i delete a record.

For example i have inserted 3 rows where 'id' is autonumber field then it will have 1,2,3 as its values. But if i delete the 3rd record then the next inserted value will be 5 ie, 1,2,3,5.. I want it to continue its sequence even if i delete any record.. What can i do to do that.?
Is there any solution for this.?

peter_budo Dec 6th, 2008 5:23 am
Re: Deletion of Autonumber
 
This is correct procedure. Can you imagine how much time would by consumed in either searching for empty position or moving data up to fill empty position in database with millions of records?

amrita.r Dec 9th, 2008 2:05 pm
Re: Deletion of Autonumber
 
Thank u for the suggestion.. i have left it like that.. i had thought there must be some solution..

debasisdas Dec 9th, 2008 2:11 pm
Re: Deletion of Autonumber
 
what about using maxvalue +1 for the next number.


All times are GMT -4. The time now is 10:28 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC