I have a table with 4 fields: _id
, to
, from
, hidden
Upon trying to insert the following values:
_id=167 from=1311005879000 to=1311005879000 hidden=0
into my table, I got an SQLiteConstraintException stating that
'column _id is not unique (code 19)'
To find the cause for this problem I tried querying the size of the table and found it is 0, so I have no idea where this is coming from.
Maybe I didn't understand the error correctly?
Edit: some code!
try {
mDatabase.insertOrThrow("groups", null,
mContentValues);
} catch (SQLException e) {
e.printStackTrace();
}
Creation SQL:
CREATE TABLE IF NOT EXISTS groups(_id LONG PRIMARY KEY,hidden INTEGER,from LONG,to LONG
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…