Subject Re: Allowing trigger to assign primary key
Author constantijnw
--- In IBObjects@yahoogroups.com, Chris Wallis <cwallis@a...> wrote:
> I'm using a TIB_StoredProc to insert records into two tables. There
is a
> trigger on one table to form a key value composed of a generated
value and
> some alpha characters. When I send the params to the TIB_StoredProc, a
> validation error is thrown since the key is not supposed to be null,
but my
> trigger will handle that. How can I work around this problem?

Hi Chris,

I suppose you have a trigger which pulls a generatorvalue conditionally:

IF (new.PK IS NULL) THEN
.....

You could extend this condition to

IF ((new.PK IS NULL) OR (new.PK = '')) THEN
......

and transfer a ParPK with value '' to the sp.