Reputation: 333
I've created this table but the auto increment connected together doesn't work properly and if i write auto increment separated it doesn't give any error but the id still (firstTableColumns[8]) 0 and doesn't incremented
db.execSQL("create table feedFirstTable ('"+firstTableColumns[0]+"' text primary key ,'"+firstTableColumns[1]+"' text,'"+firstTableColumns[2]+"' text,'"+firstTableColumns[3]+"' text,'"+firstTableColumns[4]+"' text ,'"+firstTableColumns[5]+"' text ,'"+firstTableColumns[6]+"' text ,'"+firstTableColumns[7]+"' text ,'"+firstTableColumns[8]+"' long unique autoincrement );");
Upvotes: 0
Views: 894
Reputation: 10444
Set your auto increment as integer. Why do you use firstTableColumns[8] as an auto increment id instead of using the primary key of the table:
CREATE TABLE feedFirstTable (_id INTEGER PRIMARY KEY AUTOINCREMENT,...
Upvotes: 0
Reputation: 180010
In SQLite, an autoincrementing columns must be declared as INTEGER PRIMARY KEY.
Upvotes: 1