Subject Re: [ib-support] Generated ID and constraints
Author Douglas Tosi
Hi,

> If any constraint causes an exeption user get error message but my
> generator already increased.

In the Before Insert trigger, do:
NEW.ID = GEN_ID(GEN, 0);
and in the After insert trigger:
DummyVar = GEN_ID(GEN, 1);

That way you assign the current gen value to the id, and if the insert is
successful increment the gen.
I'm not sure if this method works ok on a highly concurrent environment...

hth,
dog