Subject | RE: [ib-support] Generated ID and constraints |
---|---|
Author | Leyne, Sean |
Post date | 2001-12-19T19:05:01Z |
Doug,
Sean
> In the Before Insert trigger, do:Unfortunately, this is a very very dangerous approach!!!
> 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...
Sean