|Subject||RE: [IBO] Tables with PK AutoGen|
> If the application doesn't know the new key value before theHi Helen,
> refresh, it has no way to locate it correctly for raKeepDataPos.
> If you want this transparent behaviour, you should write your
> autogen trigger as:
> create trigger blah for blah
> active before insert
> if (new.PK is null) then
> new.PK = gen_id(my_gen, 1);
> And, in IBO, set the GeneratorLinks property:
> blah.Pk=my_gen, 1
> This way, IBO will fetch the key value before the insert is posted.
> There are several articles around this topic in the online
> FAQ. Have you ever thought of using it as a resource?
Prior to the email post I tried:
AnsiString AGenerator = "AC_ID=GEN_AC_NEW_ID";
And the table has the following trigger defined:
SET TERM ^^ ;
CREATE TRIGGER T_AC_NEW_ID FOR ALARMCODES ACTIVE BEFORE INSERT POSITION 0 AS
IF( (new.AC_ID IS NULL) OR (new.AC_ID < 1) )THEN
new.AC_ID = Gen_ID(GEN_AC_NEW_ID, 1);
SET TERM ; ^^
But as I mention it ignores me :-(
Comvision Pty. Ltd.