Subject Re: [firebird-support] How to implement sequential IDs with no missing vals?
Author Namit Nathwani
Hi Clay

At 02:25 am 18/03/2005, you wrote:
>We want sequential "admission numbers" in our app to be auto-generated for

Every app requires it but everybody is reinventing the wheel for such
sequential nos. <g> I have read the answers you have got, it was a repeat
performance for me.

>If I could wait until just before the post to grab the number, that would
>probably solve it, but again, the user wants to see this number all through
>the data-entry process.

They all do, but software engg. are not data-entry operators so they will
not know about it. My, I want to work in places where operators are so
simple, will make my life simple too. Explain in tech terms that they
cannot see the number at data-entry-time and they agree with it without a
complaint. Lucky people these.

>Any ideas on the best way to implement something like this? The best thing
>I've been able to think of so far is to select max(admission_number) from
>the table and use the next number through the data-entry process, but query
>for that value again just before posting and, if it has changed, increment
>the number again and inform the user of the numbering change. There must be
>a better way, though.

None better, if there is it is not declared for public use <g>. That is
the way to go, grab the latest number from the generator (there are ways to
manipulate the generator so the value does not get increased). At the time
of saving check the generator again, if the number has changed warn the
user, else update the generator as you would normally do. Can get
complicated from developer's point of view, but then that is the way life is.



Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://ahmedabad.sancharnet.in/vso_ad1/
namitbn@...
___________________________________________


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15/03/2005