Deletion of Autonumber

Reply

Join Date: Aug 2008
Posts: 9
Reputation: amrita.r is an unknown quantity at this point 
Solved Threads: 0
amrita.r amrita.r is offline Offline
Newbie Poster

Deletion of Autonumber

 
0
  #1
Dec 5th, 2008
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.?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,188
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 482
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: Deletion of Autonumber

 
0
  #2
Dec 6th, 2008
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?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 9
Reputation: amrita.r is an unknown quantity at this point 
Solved Threads: 0
amrita.r amrita.r is offline Offline
Newbie Poster

Re: Deletion of Autonumber

 
0
  #3
Dec 9th, 2008
Thank u for the suggestion.. i have left it like that.. i had thought there must be some solution..
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,092
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 125
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Deletion of Autonumber

 
0
  #4
Dec 9th, 2008
what about using maxvalue +1 for the next number.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC