Subject | Re: [firebird-support] Re: Best way to check a value |
---|---|
Author | Paul Vinkenoog |
Post date | 2004-07-31T12:04:58Z |
Hi Paco,
won't be in the right order anyway.
If you just need uniqueness, don't worry about the gaps - you won't
run out of numbers that quickly! :-)
If you _really_ can't have gaps (this could be the case e.g. for
invoice numbers), there are methods to achieve this, but they take
some time setting up. Here's a document you should read:
http://www.ibobjects.com/docs/ti_AuditableSeries.ZIP
Your current trigger is not bullet-proof in a multi-user environment.
Greetings,
Paul Vinkenoog
>> Is NUM supposed to be some kind of record ID? Then I suggest youWhy not? If you're filling gaps the way you do in your trigger, they
>> make it the PK and feed it from a generator:
> NUM is a numeration doc/form.
> The problem with a generator is that if the insert fails, i will
> lost the generator value. I donĀ“t want to loose this value.
won't be in the right order anyway.
If you just need uniqueness, don't worry about the gaps - you won't
run out of numbers that quickly! :-)
If you _really_ can't have gaps (this could be the case e.g. for
invoice numbers), there are methods to achieve this, but they take
some time setting up. Here's a document you should read:
http://www.ibobjects.com/docs/ti_AuditableSeries.ZIP
Your current trigger is not bullet-proof in a multi-user environment.
Greetings,
Paul Vinkenoog