Subject Re: [firebird-support] Stored procedure problem
Author Ann W. Harrison
Andrea Raimondi wrote:

A couple of suggestions.

First, try to decide how you're going to capitalize TokenID and use it
consistently.

Second, don't use gen_id (<generator>, 0). It's unlikely to be unique
or stable. Always increment the generator on first reference. Normally
that's done by incrementing the generator by one like this:

gen_id (<generator>, 1).

Third, gen_id (<generator>, <n>) is neither a table nor a procedure so
it can't be the record source for a select. Use:

<value> = gen_id (<generator>, <increment>);


Regards,


Ann

There are cases for using gen_id (<generator>, 0). One is when checking
the current generator value as discussed last week.