Subject | Re: [ib-support] Generated ID and constraints |
---|---|
Author | Douglas Tosi |
Post date | 2001-12-19T17:16:52Z |
Hi,
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
> If any constraint causes an exeption user get error message but myIn the Before Insert trigger, do:
> generator already increased.
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