Subject RE: [firebird-support] Generators, revisited
Author Kevin Stanton
Thanks Helen, I'm in the hunt for the evil code and I've also downloaded
the demo app from IBO that you mentioned in your book (thank you for the
book!).

The only reason why I'm getting the generator value via a query is each user
wants to have sequential numbers for their own batch of invoices. So I go
and retrieve x number of invoices, thus the step in retrieving the generator
value.

Kevin

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Sunday, September 12, 2004 8:08 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Generators, revisited


At 07:40 AM 12/09/2004 -0700, you wrote:
>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.


[Non-text portions of this message have been removed]