Subject Re: [firebird-support] Simple trigger task
Author Helen Borrie
At 11:13 PM 16/11/2003 +0100, you wrote:

> > This is not a safe way to increment numbers in a multi-user
> > environment.
>
>well I know, but inserts are not frequent on this table, and only
>performed by one single user, so I guess it should be safe here...
>
> > If it is a plain number, create a generator for it:
> >
> > create generator gen_pers_number;
> > commit;
> > set generator gen_pers_number to n; (your starting number)
>
>the staring number, you mean with an empty table?

Starting number = starting number of the generator. It can be set to
anything at all.

>In fact I have about 600 records in that table already, and the next
>value would be like (SELECT MAX(PERS_NUMBER) FROM WT_PERS)+1

Yes, calculate the current highest number and make that the starting number
for the generator. The next number generated will be current value + 1.

heLen