Android SQLite Insert or Update

后端 未结 8 1958
太阳男子
太阳男子 2020-12-04 09:38

as can be seen in the documentation the syntax to make insert or update is : INSERT OR REPLACE INTO

() VALUES (), my
8条回答
  •  无人及你
    2020-12-04 10:23

    What about replaceOrThrow(String table, String nullColumnHack, ContentValues initialValues)

    Docs say... Convenience method for replacing a row in the database. Inserts a new row if a row does not already exist.

    Basically it calls insertWithOnConflict

提交回复
热议问题