Subject | RE: [firebird-support] A bit strange GEN_ID result |
---|---|
Author | Alan McDonald |
Post date | 2004-02-21T12:20:04Z |
> In order to get the last inserted id I made this stored as a test:this makes no sense
>
> CREATE PROCEDURE NEW_PROCEDURE
> AS
> declare variable var integer;
> BEGIN
> select max(GEN_ID("Table1_ID_GEN",1)) FROM "Table1" INTO :var;
> insert into "Table1" ("ID") VALUES (:var);
> SUSPEND;
> END
>
max(generator)???? There's no such thing as a maximum of a single newly
generated value
just select the generator into your var
But really now - why are you wanting the last inserted ID?
Alan