Subject | Re: [IBO] DSQL question |
---|---|
Author | Geoff Worboys |
Post date | 2001-03-16T10:10:49Z |
> I have a DSQL component that inserts records in a table. ISince you are using DSQL I am supposing that you are assigning the
> 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.
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