Issue
I'm using the SQLite with Android, and I want to know the best way to get the generated id of the row I inserted.
A solution I think makes a search after include, but it doesn't look the best way.
Solution
The insert
method returns the id
of row just inserted or -1
if there was an error during insertion.
long id = db.insert(...);
where db is SQLiteDatabase
.
Answered By - GrAnd
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.