Why SQLite Primary Key column auto incrementing is not working? [closed]
I am using SQLite3 in my Android app and I was having a hard time trying to query records I had already insert.
After much debugging, I found out that the problem was that the SQLite
auto increment was NOT working.
The problem is that SQLite3 treats
"CREATE TABLE test_table (
id **INT** PRIMARY KEY,
name text)";
differently from
"CREATE TABLE test_table (
id **INTEGER** PRIMARY KEY,
name text)";
Using INTEGER PRIMARY KEY
works fine to create an auto increment column, whereas
using INT PRIMARY KEY will simple NOT work.
Thanks this author where I found this info. http://mydumbthoughts.wordpress.com/2010/06/12/sqlite-primary-key-column-not-auto-incrementing/
精彩评论