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

Reply via email to