SQLite: How to get the “autoincrement” value from the last insert
By Alvin Alexander. Last updated: June 3 2016
SQLite autoincrement FAQ: How do I get the autoincrement value from my last SQLite INSERT
command?
You can get the integer value of the primary key field from the last insert into an autoincrement field using a SQLite function named last_insert_rowid()
, as shown in the example below.