Re: [sqlite] duplicate row in sqlite3 database
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of RSmith > Sent: Friday, May 09, 2014 2:01 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] duplicate row in sqlite3 database > > That sounds NOTHING like a violation error... it seems a lot more like > the intermediate thing failed on communicating, but I am not familiar > with it (I hope another poster might have advice) - unless it simply > does not understand the serialized output. Either way it doesn't feel > right to me. It only happens when I try it insert a duplicate row, otherwise things are working very well. It doesn't feel right to me either, but this is not unusual for VEE. VEE is a large interpreted environment. There is so much going on between the user and the cpu that error codes are sometimes obfuscated to the point that you see here. I just have to assume that an error on INSERT is due to a duplicate row. There's nothing else I can do. > > > On 2014/05/09 19:52, Drago, William @ MWG - NARDAEAST wrote: > > 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 > > > > > > ___ > 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
Re: [sqlite] duplicate row in sqlite3 database
That sounds NOTHING like a violation error... it seems a lot more like the intermediate thing failed on communicating, but I am not familiar with it (I hope another poster might have advice) - unless it simply does not understand the serialized output. Either way it doesn't feel right to me. On 2014/05/09 19:52, Drago, William @ MWG - NARDAEAST wrote: 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 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] duplicate row in sqlite3 database
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
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
Re: [sqlite] duplicate row in sqlite3 database
> -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? > -- > Igor Tandetnik > > ___ > 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
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. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] duplicate row in sqlite3 database
Look into the ON CONFLICT clause -Ursprüngliche Nachricht- Von: techi eth [mailto:techi...@gmail.com] Gesendet: Donnerstag, 08. Mai 2014 11:14 An: General Discussion of SQLite Database Betreff: [sqlite] duplicate row in sqlite3 database Hi, SQlite3 have any method where it can avoid adding duplicate row or throwing error status code on duplication., Techi- ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users --- Gunter Hick Software Engineer Scientific Games International GmbH Klitschgasse 2 – 4, A - 1130 Vienna, Austria FN 157284 a, HG Wien Tel: +43 1 80100 0 E-Mail: h...@scigames.at This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice as to its status and accordingly please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any person as to do so could be a breach of confidence. Thank you for your cooperation. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] duplicate row in sqlite3 database
On Thu, 8 May 2014 14:44:19 +0530, techi ethwrote: >Hi, > >SQlite3 have any method where it can avoid adding duplicate row or throwing >error status code on duplication., > >Techi- What Simon said; and you can also define the behaviour in the table definition in an ON CONFLICT clause: http://sqlite.org/lang_conflict.html -- Groet, Cordialement, Pozdrawiam, Regards, Kees Nuyt ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] duplicate row in sqlite3 database
On 8 May 2014, at 10:14am, techi ethwrote: > SQlite3 have any method where it can avoid adding duplicate row or throwing > error status code on duplication., Instead of INSERT ... do INSERT OR IGNORE ... This means that instead of returning an error code if you violate a constraint, SQLite just returns SQLITE_OK as if the command succeeded. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] duplicate row in sqlite3 database
Hi, SQlite3 have any method where it can avoid adding duplicate row or throwing error status code on duplication., Techi- ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users