works only when the database is initialized.
If you start the program and read a database and run SELECT last_insert_rowid() then you get 0.
Then after having added an entry and you call SELECT last_insert_rowid() then you get the right value.
If you have a column with the type of INTEGER PRIMARY KEY you can get the max value of this column with SELECT max(RowID) FROM DBTableName
I know this is a little late posting... but for anyone else who's searching for this, check the documentation of this function Last Insert Rowid
See ya!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.