Subject Re: [firebird-support] Re: Generators for auto-increment - with override
Author Ann W. Harrison
> Ann W. Harrison wrote:
>> ... Pierre Y. (?) suggested comparing
>>the key provided to the current generator value and incrementing the
>>generator by the difference if the key provided was larger. That works
>>and doesn't involve reading all the records in the table whenever a key
>>is provided.

> Daniel L. Miller wrote:

> This assumes that either the generator value or the specified key is
> still greater than any existing record in the table. That may be a
> perfectly reasonable assumption - but it's not a guarantee.

It will be a guarantee if it's part of the after-insert and after update
triggers on the table.

Regards,


Ann