Subject Re: [IBO] DSQL question
Author Geoff Worboys
> I have a DSQL component that inserts records in a table. I
> have a Before Insert trigger with : NEW.RegistNo = gen_id
> (RegistNo_Gen, 1). After the DSQL component, I would like to
> know the value of NEW.RegistNo.

Since you are using DSQL I am supposing that you are assigning the
parameter values in code. What I do in this situation is...

tmpID: int64;
tmpID := MyDSQL.GeneratorValue('MYGEN',1);
MyDSQL.ParamByName['RegistNo'].AsInt64 := tmpID;

now I have tmpID that I can use as a parameter to do related things.

This presumes that any insert trigger will only generate a new
identity value if the if New.RegistNo IS NULL. (Which is HIGHLY


Geoff Worboys
Telesis Computing