Subject Re: [IBO] insertSQL Help please (again)
Author newgen3152003
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?

help






--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 01:20 AM 9/03/2004 +0000, you wrote:
> >Helen, what am I doing different with the trigger from before? it
> >still increments 2.
>
> See below.
>
> >if I remove generatorlinks
> >IDLOC=GEN_LOCATIONS_IDLOC
> >i get an error
> >Field IDLOC must have a value
>
> Well, you get that because IDLOC is a required field.
>
>
> >what am I doing wrong?
>
> Probably the old trigger is still in the metadata cache. You need
to log
> out of all connections to clear the old caches. (if you can do so,
stop
> and restart the sever). First login after the caches are cleared
will
> activate the new version of the trigger (if you committed it
before, that
> is! :-) )
>
> Helen