I'm looking for the equivalent of Scope_identity() or @@identity in sql server, except for sqllite?
I'd hate to resort to a max select on the id column, but that is plausible.
Since I have never used SQL Server, I am not exactly sure what @@IDENTITY
does, but if I understand this document correctly, then sqlite3_last_insert_rowid()
may be what you are looking for.
last_insert_rowid()
This function returns the ROWID of the last row insert from the database connection which invoked the function. The last_insert_rowid() SQL function is a wrapper around the sqlite3_last_insert_rowid() C/C++ interface function.
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With