Home » Developer & Programmer » Forms » Sequence is the best choice??
Sequence is the best choice?? [message #151066] Mon, 12 December 2005 23:49 Go to next message
Scarlet.Zhu
Messages: 22
Registered: December 2005
Location: Shanghai
Junior Member
It is always suggested that sequence is applied for its easy use. However, it causes waste if insert,update,create is on failure. That is, seq.getnextval() executes, but it never rolls back. Don't you think that getting the maximum value of a column and increasing it by a specific interval value is a better approach??

Scarlet

[Updated on: Mon, 12 December 2005 23:50]

Report message to a moderator

Re: Sequence is the best choice?? [message #151105 is a reply to message #151066] Tue, 13 December 2005 03:11 Go to previous messageGo to next message
ashishmate
Messages: 90
Registered: February 2005
Location: Mumbai
Member

hi

ya i t will be better only if singal user is fetching value but if there are more than one user using it than it will return same value for all user.
Re: Sequence is the best choice?? [message #151221 is a reply to message #151066] Tue, 13 December 2005 17:19 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If you are 'showing' the number to user and they DEMAND that they be in sequence then use the MAX+1 method but do it in the database trigger, not in your form. That way, if the user decides NOT to save the record you haven't 'burned' an entry.

If the user doesn't see the number then why worry. If you want them to be almost seqential then when you define the sequence use NOCACHE so that the numbers are 'created' sequential. If you have a hi-speed data source that needs sequences then you really should specify a CACHE value of an appropriate number.

David
Previous Topic: 40200-Field is protected against update
Next Topic: default values
Goto Forum:
  


Current Time: Fri Sep 20 05:30:59 CDT 2024