Subject Re: [IBO] Appending & Required Fields
Author Ed Dressel
> 2. Set a generator link: <tablename>.PLAN_ID=<GeneratorName>
> and make sure you are testing the value for null in the trigger so you

> don't overwrite it afterwards.
> Trigger example:
>
> if (new.PLAN_ID is null) then new.ID=Gen_id(Gen_PLAN_ID, 1);
>
> BTW: generator links can be set at the connection level so if you use
a
> single table with multiple TIB_Queries it
> only has to be set once

This works nicely for the first record, but I am getting an exception on
the second append:

ISC ERROR MESSAGE:
violation of PRIMARY or UNIQUE KEY constraint "INTEG_2" on table "PLANS"
'. Process stopped. Use Step or Run to continue.

It seems that the GEN_PLAN_ID is not being incremented. I have tried
various forms of


<tablename>.PLAN_ID=<GeneratorName>
<tablename>.PLAN_ID=GEN_ID(<GeneratorName> )
<tablename>.PLAN_ID=GEN_ID("<GeneratorName>")

How do I get it to increment?

Thanks
Ed Dressel




[Non-text portions of this message have been removed]