Android Question How do I get value of an auto increment field, after insert

davepamn

Active Member
Licensed User
Longtime User
I want to get the id value of the an auto increment field in sqlite . What cursor method will return the id value
 

davepamn

Active Member
Licensed User
Longtime User
I use auto increment and am looking for a way to get the scalar value without out running a max id or desc id sort. if this is not possible I will run a query to get the id.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Did you not read the post in the link I provided?

The important bit in the link was the
RowID = SQL1.ExecQuerySingleResult("SELECT last_insert_rowid() FROM table1")
This will provide you with your scalar value of the ID that was added. I figured it was better to link the post and provide credit where credit is due rather than rehash it.
 
Upvote 0
Top