mardi 14 avril 2015

Android exception while creating SQLite database

I am writing an SQLite Database with multiple tables. The first 2 tables were successfully created however I keep getting this message for the third table: SqliteDatabaseCpp(7830): sqlite returned: error code = 1, msg = AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY, db=/data/data/http://ift.tt/1PHS00w. I verified the query over and over but I can't spot any syntax error. Here's the query that is supposed to create the third table:



private String CREATE_TABLE_CLIENTS="CREATE TABLE " +TABLE_CLIENTS + " ( " +
BaseColumns._ID+" INTEGER PRIMARY KEY AUTOINCREMENT, " +
CLIENT_NAME+" TEXT, "+
EMAIL+" TEXT, " +
TELEPHONE+" INTEGER, "+
BIRTH+" TEXT, " +
CLIENT_ADDRESS+" TEXT, "+
PASSWORD+ " TEXT)";


If anyone spots the problem can you please leave a reply? Thank you!


Aucun commentaire:

Enregistrer un commentaire