Subject | A bit strange GEN_ID result |
---|---|
Author | ionokot_k |
Post date | 2004-02-21T10:53:19Z |
In order to get the last inserted id I made this stored as a test:
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
Calling this procedure more than three times the generated
id are not "linear":
Table1
ID
row1 1 OK
row2 2 OK
row3 3 OK
row4 5 huh?
row6 7 !!!
row7 11 what the hell?
row8 16 but...
row9 22 #@?ยง#!!
and so on
With an
"INSERT INTO "Table1" ("ID") VALUES (GEN_ID("Table1_ID_GEN",1))
works fine...
What's wrong????
Thanks in advance,
IK
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
Calling this procedure more than three times the generated
id are not "linear":
Table1
ID
row1 1 OK
row2 2 OK
row3 3 OK
row4 5 huh?
row6 7 !!!
row7 11 what the hell?
row8 16 but...
row9 22 #@?ยง#!!
and so on
With an
"INSERT INTO "Table1" ("ID") VALUES (GEN_ID("Table1_ID_GEN",1))
works fine...
What's wrong????
Thanks in advance,
IK