Subject Re: [firebird-support] Optized index
Author Ann W. Harrison
skander_sp wrote:
>
> In the trigger before insert I load N_Doc as higher numer of same
> year, this way:
>
> select coalesce(max(N_Doc),0)+1
> from Docs
> where N_year=new.N_year
> into new.N_Doc;

Don't do that. It doesn't work multi-user. Let me say that
again - assigning identifiers by finding the max identifier currently
used does not work in Firebird. You'll get duplicates.

Either use a generator or check the archives of this list of
multi-user safe ways of creating unique identifiers.

Regards,


Ann