Subject Re: [ib-support] Determining generator's current value
Author Lucas Franzen
Don Schoeman schrieb:
>
> Using the standard trigger/generator method to create a unique primary key
> value for a newly inserted record, is there a way to determine the primary
> key/generator value of the record I have just inserted? I want to insert the
> new record using a stored proc. and then use the primary key's value to do
> further processing within the same stored proc.

Use a local variable inside the procedure.

create procedure xy ...
as
declare variable newkey INTEGER;
begin

newkey = GEN_ID ( G_SOMETHING, 1 );

etc.


Regrads
Luc.