I\'m trying to create a table in my DB with an ID that is autoincrement itself but whenever I try to add the AUTOINCREMENT keyword to my query it tells me that :
Create table with integer primary key no need to explicitly mention the AUTOINCREMENT
e.g.
CREATE TABLE t1(
a INTEGER PRIMARY KEY,
C TEXT
);
Insert into t1(C) values("Hello");
You need to add a space between KEY_ID
AND INTEGER
So change
+ KEY_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, "
to
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
Create Table like this put some space before INTEGER ....
"CREATE TABLE "+TABLE_NAME+" ("+KEY_ID+" INTEGER PRIMARY KEY AUTOINCREMENT)";