2 messages in com.googlegroups.android-developersSQLite Database Issue.
FromSent OnAttachments
Android-Berry28 Mar 2008 07:53 
OmarFlores28 Mar 2008 10:38 
Subject:SQLite Database Issue.
From:Android-Berry (lvgu@gmail.com)
Date:03/28/2008 07:53:12 AM
List:com.googlegroups.android-developers

Hi ALL,

I open a data base and create table on my database, but when I want to insert a record, why do I need to define my table primary key values?

here is the query to create table:

CREATE TABLE form ( _id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT NOT NULL ,addr TEXT NOT NULL ,user TEXT NOT NULL ,pass TEXT NOT NULL ,definition TEXT NOT NULL ,icon INTEGER NOT NULL ,count INTEGER NOT NULL );

I have defined _id as primary key and auto increment, but when I insert a record:

here is the query: [code] sqlite> insert into form values(11,22,33,44,55,66,77); insert into form values(11,22,33,44,55,66,77); SQL error: table form has 8 columns but 7 values were supplied

sqlite> insert into form values(11,22,33,44,55,66,77,88); insert into form values(11,22,33,44,55,66,77,88);

sqlite> select * from form;

select * from form; _id|name|addr|user|pass|definition|icon|count 11|22|33|44|55|66|77|88

sqlite> [/code]

Thanks so much~