Subject | RE: [firebird-support] Re: Sequential auto incremental numbering |
---|---|
Author | Christian Giesen |
Post date | 2018-09-03T12:57:03Z |
Hi Helen,
Thanks for the info and the sample Delphi source code. I will check it out in the next few days.
Kind regards,
Christian Giesen
Managing Member
Express Talent cc
Mobile: +27 82 574 5566
E-Mail: chris@...
Alt Email: cvgiesen@... or cvgiesen@...
This message contains private and confidential Information. If you are not the intended addressee indicated in this message or you are not responsible for the delivery of such messages to the intended recipient, you may not copy or deliver this message to anyone. You may not use any information gleaned from this message for the benefit or promotion of yourself or your organization. If such is the case, please destroy this message immediately and kindly notify the sender by return of E-Mail. Express Talent cc takes no responsibility whatsoever resulting in you misusing information contained in this message and doing so may render you liable for the consequences of misusing said content of this E-Mail message.
From: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Sent: Monday, 03 September 2018 11:34
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Re: Sequential auto incremental numbering
Lester wrote:
> On 03/09/18 07:29, 'Christian Giesen' chris@... [firebird-support]I think this is the article Lester was referring to:
> wrote:
>> NextInvNo = (SELECT MAX(INVOICE_NO) FROM INVOICE) + 1;
> Christian ... there was many years ago a very nice article on this very
> problem.
http://www.ibobjects.com/docs/ti_AuditableSeries.ZIP
I wrote it. It was a long time ago but it still applies. The thing
about generators is not that you can't rely on uniqueness (you
absolutely can!) but that you can't go back and *reuse* a number if your
transaction is rolled back for some reason. Back then, accountants
used to insist that accounting documents have unique numbers *in an
unbroken sequence*. Some countries still require this, so this
article will help you if you are stuck with this limitation.
But definitely, the moment you start meddling with the values of
generators, you are making a bed of nails. Incidentally, there *are*
ways to turn back generators so, theoretically, you could "re-use" a
missing value. In practice, you must not try to.
Helen
---
This email has been checked for viruses by AVG.
https://www.avg.com