Subject RE: [firebird-support] Generators, revisited
Author Helen Borrie
At 07:40 AM 12/09/2004 -0700, you wrote:
>This is a bit scary - the possibility of generators returning invalid
>numbers - numbers already used. If generators truly worked outside the
>transaction, the number should be incremented whenever called upon.

As it is, you can be assured on that.

>I got most of the code below from Ann and Helen - Ann regarding the actual
>SQL statement and Helen for the proper retrieval using the IBO TIB_DSQL
>component with proper transaction handling.

It's not a question "proper transaction handling". If you really are
getting dups in these keys, you can bet your life that you have some
application or trigger code that is fiddling with generator values.

>I'm going to have to go overboard on code now in my Delphi app to make sure
>the numbers generated don't already exist in the system.

To fix a current mess, yes. But once you have found that evil code and
demolished it, you can "set and forget".

I think you might be a bit misguided about retrieving generators in IBO, as
well. To put it simply, you *don't* have to retrieve them with an explicit
query in IBO. If you want more information, ask in the IBO list.