Subject Re: Auto Generate nos. but trigger won't work
Author Svein Erling
Well, there may be a couple of different reasons. You do realise that
the trigger fire at the server, so that the client will not be able to
see the newly inserted record without requerying? Another thing is
that some tools (at least IBO, which is what I use) know that a
primary key has to be filled out, and you have to specifically tell
IBO that the field is not required if you ever want your trigger to
fire.

Set

--- In firebird-support@yahoogroups.com, Venus Software Operations:
> Dear all
>
> Hi. I have this FDB which has a table with an integer PK field.
> I have also defined a Generator and a Before Insert Trigger using
> the following code:
> IF (NEW.IID IS NULL) THEN
> NEW.IID = GEN_ID(GEN_MSALESREPS_IID,1);
>
> Yet I am unable to autogenerate the PK. From my app I have to
> specifically call the generator for a new PK value.
>
> What am I doing wrong. Please Advise.