BACKGROUND OF THE PROBLEM: I have two tables, where the main key is text fields.
When I reuse SQLiteDatabase.insertWithOnConflict(myTable, null, myValues, SQLiteDatabase.CONFLICT_REPLACE) with the same data, I see that all returned values โโare returned.
So, it looks like INSERT is executing (instead of REPLACE) for the same datasets.
Problem: However, looking at these tables using the "SQLite Database Browser", I see the correct number of records that I expect when executing REPLACE.
The root of my confusion is the description of the Android documentation, which says: * Returns the row identifier of the newly inserted row OR the primary key of the existing row if the input parameter is "Algorithm conflict" = CONFLICT_IGNORE OR -1 if any error *
Question: Why is REPLACE executed, but the row identifier of existing data is not returned?
source share