I have created a table (Detail) with two columns one column (ID) is primary and auto-increment while the other column (EmpName) is varchar type. While inserting data in database i am only inserting data in EmpName column using the following code. But I want to know the details of that record (ID and name but i know only name and ID is created by database). I can write another select statement and get the last record of the cursor after executing the insert query but if another insertion will be done before executing the select statements then my database will give me wrong result. How can i get the details?
ContentValues initialvalues = new ContentValues();
initialvalues.put("EmpName", "John");
db.insert("Detail", null, initialvalues);// db is database
The above code is working fine for insertion of data in database but How to get that details?
please the API:SQLiteStatement.executeInsert()
According to the source code: