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...

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

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
recommended.)


HTH

Geoff Worboys
Telesis Computing