Subject Re: [IBO] GENERATORS
Author Lucas Franzen
radevojvodic schrieb:
>
> Hi All,
>
> I'm thinking about GeneratorLink usage and i find it unefficient. For
> example if you set this property for a primary key and you put your
> query in insert state generator is called imedietly. So you
> incremented generator value. Then You cancel insert and your
> generator value is still incremented.

And?

What's the problem with that???

A generator value is qualifying, not quantifying!

So you shouldn't care about gaps!

If you generate the pk-field in a trigger you've got a problem on your
client side that you can't continue working with this value (i.e. if you
want to add a master record and then immediately start inserting detail
records).

If you don't want to use the GeneratorLinks and need the value on the
client side you can use the BeforePost event of the query and assign a
value by calling the GEN_ID method from the IB_Query or IB_Connection.


Luc.