You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is an new feature.... this can help people to migrate app from MySQL /MSSQL server....( wich uses @LASTI_INSERTED_ID..... ) whitout changes to logical app....
select GEN_ID(....,0) is not an correct solution...... this is not PER SESSION..... and can cause bad reads....(i think)
The text was updated successfully, but these errors were encountered:
Remember that GEN_ID use a secuence and this is a global object and you can get last id en everywhere.
I recommend that you think about Identity column in firebird , and use when you need know las id
the next statement:
INSERT INTO PERSON(NAME,LAST_NAME) VALUES('JOHN','MONTANA') RETURNING IDPERSONA
(With this you get the id generate in firebird in a secuence or with identity column)
AND if you want store the id in a variable you can use this statement
INSERT INTO PERSON(NAME,LAST_NAME) VALUES('JOHN','MONTANA') RETURNING IDPERSONA INTO :IDPERSONA (THIS IS A VARIABLE)
I DONT RECOMMEND GEN_ID(....,0) USE FOR GET LAS ID , BECAUSE OTHER USER CAN INSERT RECORD IN THE SAME TIME AND YOU SECUENCE MAYBE DONT BE EXACT
Submitted by: Sebastian (jsb977)
Like:
currval(regclass) in postgres
This Return value most recently obtained with nextval for specified sequence
Postgres and oracle are similar:
http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html
this is an new feature.... this can help people to migrate app from MySQL /MSSQL server....( wich uses @LASTI_INSERTED_ID..... ) whitout changes to logical app....
select GEN_ID(....,0) is not an correct solution...... this is not PER SESSION..... and can cause bad reads....(i think)
The text was updated successfully, but these errors were encountered: