Subject | Re: [IBO] insertSQL Help please |
---|---|
Author | stanw1950 |
Post date | 2004-03-08T22:37:51Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
Why even use a trigger if you are using generatorlinks for all your
inserts? Or, why use generatorlinks if you are using a trigger? It
seems to me that you should only use one or the other, but not both,
or am I missing something?
Stan Walker
> At 04:30 PM 8/03/2004 -0400, you wrote:I do
> >Thanks,
> >
> >I do not see 2 blank rows, only the generator gets inc by 2. I have
> >generatorlinks set, would that cause it? if generatorlinks is set
> >not need a trigger?avoid firing
>
> Your trigger needs to be
> if (new.ID is not null) then
> new.ID = gen_ID (your_generator, 1);
>
> The null test is essential if you are using generatorlinks, to
> the trigger when you already have the value.Helen,
>
> Helen
Why even use a trigger if you are using generatorlinks for all your
inserts? Or, why use generatorlinks if you are using a trigger? It
seems to me that you should only use one or the other, but not both,
or am I missing something?
Stan Walker