Pages

2011-01-12

Get last insert ID in Firebird

Firebird 2 introduces RETURNING clause for INSERT statements, so you can get the inserted value in a single go, just like with MySQL and some other database systems:

INSERT INTO t1 (...) values (...) returning pk;

PK
===========
32
 

That's it!

No comments:

Post a Comment