Subject Re: [IBO] insertSQL Help please (again)
Author Helen Borrie
At 02:04 AM 9/03/2004 +0000, you wrote:
>I recreated the DB with this code for the trigger(made extra sure to
>clean the cache
>
> SET TERM ^;
> CREATE TRIGGER TRIG_LOCATIONS_BI FOR LOCATIONS BEFORE INSERT
> AS BEGIN
> IF(NEW.IDLOC IS NULL) THEN NEW.IDLOC = GEN_ID
>(GEN_LOCATIONS_IDLOC,1);
> END ^
> SET TERM ;^
>
>in generatorlinks the line
>IDLOC=GEN_LOCATIONS_IDLOC
>
>when I insert/post with dbnavigator, the same problem generator
>increments 2, I'm getting frustated
>what is wrong??? I do not have any other code executing an insert.
>Isn't this the proper usage?

Yes, it sure is. Maybe there's something else you overlooked, that you
haven't mentioned. What, if any, code handling do you have surrounding
this insert?
(Provide the handling...)

I guess you do realise that *you* don't do anything with that PK
value. IBO knows to get the generator value if you have specified a
generatorlink for it....

Where have you located the generatorlink? In the dataset or in the
connection? If the latter, then you must use the qualified column-name...

Helen