Subject | Re: [IBO] Appending & Required Fields |
---|---|
Author | Ed Dressel |
Post date | 2003-08-20T20:11:12Z |
> 2. Set a generator link: <tablename>.PLAN_ID=<GeneratorName>a
> 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
> single table with multiple TIB_Queries itThis works nicely for the first record, but I am getting an exception on
> only has to be set once
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]