Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-19 Thread Vincent Vega
at sqlite3_prepare_v2() by calling sqlite3_finalize() . - Original Message From: Dennis Cote <[EMAIL PROTECTED]> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Wednesday, March 19, 2008 12:06:04 AM Subject: Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-18 Thread Jay A. Kreibich
On Tue, Mar 18, 2008 at 04:06:04PM -0600, Dennis Cote scratched on the wall: > Vincent Vega wrote: > > query = sqlite3_mprintf("Insert into Inventory (Tag) values (?)"); > > This allocates memory and saves a pointer to it in query. My question is why use "sqlite3_mprintf()" at all? You're

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-18 Thread Dennis Cote
Vincent Vega wrote: > Well , since I do need to avoid a case where duplicated tags are > inserted ,I have added a treatment to the case of SQLITE_CONSTRAINT. OK, but what you have shown doesn't do anything useful. If your Tag values must really be unique, then it is an error to insert a

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-18 Thread Vincent Vega
e Database <sqlite-users@sqlite.org> Sent: Monday, March 17, 2008 11:10:35 PM Subject: Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step Vincent Vega wrote: > Thanks a lot . Your explantion does make sence. > I'll remove the UNIQUE index and see if it helps. > You probably

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-17 Thread Dennis Cote
Vincent Vega wrote: > Thanks a lot . Your explantion does make sence. > I'll remove the UNIQUE index and see if it helps. > You probably shouldn't remove the index, just remove the unique keyword from the create index statement. create index InventoryIndex on Inventory (Tag); If you have an

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-17 Thread Vincent Vega
8 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 th

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-17 Thread Dennis Cote
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

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-16 Thread David Bicking
IL PROTECTED]> > Subject: Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step > To: [EMAIL PROTECTED], "General Discussion of SQLite Database" > <sqlite-users@sqlite.org> > Date: Sunday, March 16, 2008, 4:37 AM > Sorry.. I didn't copy it correctly.. >

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-16 Thread Vincent Vega
sqlite3_reset(Statement) ; } sqlite3_finalize(Statement) ; sqlite3_exec(db,"END;",NULL,NULL,) ; - Original Message From: Jay A. Kreibich <[EMAIL PROTECTED]> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Sent: Saturday, March 15, 2008 3:07:46 AM Subjec

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-14 Thread Jay A. Kreibich
On Fri, Mar 14, 2008 at 04:09:50PM -0700, Vincent Vega scratched on the wall: > for (i=1;500;i ++) > { I can't say about your CONSTRAINT problem, but that's an infinite loop. And 1? Seriously? Without a full description of the table and all the indexes on the table (and, if

[sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-14 Thread Vincent Vega
Hi all , I am trying to insert about 500 records to a table. I have tested my code and it works fine (All 500 recoreds are put in the table in about 250 miliseconds) but from time time I get SQLITE_CONSTRAINT error code after the sqlite3_step (1 out of 7 times). Any idea on how to prevent this ?