Subject Re: Is it possible to suspend a generator?
Author grip_2ls
Hi

Thank you both - you are correct that it is a trigger, so I can just make that inactive.

Thanks

Neil

--- In firebird-support@yahoogroups.com, Doug Chamberlin <chamberlin.doug@...> wrote:
>
> On 3/13/12 8:17 AM, grip_2ls wrote:
> > I need to insert some data with fixed IDs. The table that I am inserting into already has data and a generator for the IDs. The new data is below the value of the generator and the IDs do not already exist. Can I suspend the generator while I insert these new rows and if so how?
>
> Many implementations that use generators for creating primary keys do so
> using triggers that assign the ID values. But those triggers are written
> to only do so if the primary key field is still NULL when the trigger
> fires. That way the application can assign primary keys when it knows
> the values it wants to use and the trigger does it when the application
> does not want to bother with this detail. I suggest you modify your
> triggers to match this strategy.
>
> Doug C.
>