When I deliberately try to insert a duplicate row I get the following error from my VEE* environment:
Execution of method ExecuteNonQuery in the referenced .NET object or type failed. Exception type: System.Runtime.Serialization.SerializationException Type is not resolved for member 'System.Data.SQLiteException, System.Data.Sqlite, Version=1.0.92...' If that sounds like a duplicate row error, I'll trap it and display a message to the user. -Bill *About VEE: http://cp.literature.agilent.com/litweb/pdf/5990-9117EN.pdf > -----Original Message----- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of RSmith > Sent: Friday, May 09, 2014 12:06 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] duplicate row in sqlite3 database > > > On 2014/05/09 17:58, Drago, William @ MWG - NARDAEAST wrote: > >> -----Original Message----- > >> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > >> boun...@sqlite.org] On Behalf Of Igor Tandetnik > >> Sent: Thursday, May 08, 2014 9:48 AM > >> To: sqlite-users@sqlite.org > >> Subject: Re: [sqlite] duplicate row in sqlite3 database > >> > >> On 5/8/2014 5:14 AM, techi eth wrote: > >>> SQlite3 have any method where it can avoid adding duplicate row or > >>> throwing error status code on duplication., > >> Define a UNIQUE constraint or a unique index on those columns you > >> don't want duplicated. Then an attempt to insert a duplicate row > >> would result in an error. > > An error as in program crash or an error code? > > > > > A returned error code which you can use to look up the meaning of > (there are many possible things that might cause an error). If the > meaning turns out to be a failed constraint, then you know why the > Insert did not complete. > > If you do not particularly care for specifically the constraint > failure, but just want the row inserted if it does not violate the > constraint, then one of two ways can be used, defining an ON CONFLICT > clause in the schema or more generally used, the SQL syntax "INSERT OR > IGNORE INTO xxx... " which is much the same as INSERT with an ON > CONFLICT IGNORE clause... details of all this can be found on the > conflict docs in the sqlite.org site. > > http://www.sqlite.org/conflict.html > http://www.sqlite.org/lang_conflict.html > http://www.sqlite.org/lang_insert.html > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users