Dennis , Thanks a lot . Your explantion does make sence. I'll remove the UNIQUE index and see if it helps.
Vincent. ----- Original Message ---- From: Dennis Cote <[EMAIL PROTECTED]> To: General Discussion of SQLite Database <[email protected]> Sent: Monday, March 17, 2008 4:27:11 PM Subject: Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step Vincent Vega wrote: > Anyhow, as I said before the code works fine most of the times(I can > insert 500 records to the table and read them correctly) but from time > to time I get SQLITE_CONSTRAINT error code after the sqlite3_step. > Any Idea why? > > Here are the table defenitions : > CREATE TABLE 'Inventory' ( > 'TagIndex' integer PRIMARY KEY, > 'Tag' varchar(12) NOT NULL, > ) ; > > CREATE UNIQUE INDEX InventoryIndex ON Inventory (Tag); > Vincent, You are almost certainly inserting the same value a second time into the Tag column. You have added a unique index to this column which will raise a constraint error if you try to insert a row that has the same value in that column as some other row. If you don't really require that the Tag column data be unique for each row, then change your index to o normal index without the unique constraint. HTH Dennis Cote _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

