Is it possible to apply primary key on the text fields in android database

前端 未结 2 1056
小蘑菇
小蘑菇 2020-11-30 12:22

I have created a simple table that contains the name and email id\'s of the persons. When i am giving the create query like this:

\"create table contacts (name

2条回答
  •  感情败类
    2020-11-30 13:02

    SQLiteDatabase.insertOrThrow() should throw an exception if the value could not be inserted. Also its return values, as well the one from SQLiteDatabase.insert() is the rowid of the inserted row or -1 if it fails. You should opt for any of these alternatives in your code.

提交回复
热议问题