Re: [sqlite] Unique Constraint Failed

2018-09-14 Thread Rob Richardson
Dumb question: are you sure you're only inserting one record at a time? Is it possible you're inserting records so fast that the timestamp is the same for two of them? On Fri, Sep 14, 2018 at 3:30 PM Andrew Stewart wrote: > Hi, > I am having problems with a database reporting

Re: [sqlite] Unique Constraint Failed

2018-09-14 Thread Keith Medcalf
ndrew Stewart >Sent: Friday, 14 September, 2018 14:14 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] Unique Constraint Failed > >Hi all, >I realize that this is the constraint that is >failing. The data is very large, encrypted and at a customer's sit

Re: [sqlite] Unique Constraint Failed

2018-09-14 Thread ward
I'm just beginning to look at sqlite so this approach might not apply. In instances where I had no control on the input stream and an occasional duplicate could occur I fed the input stream into a temp table then used a select from that temp with a count function and a group by ID, DateTime

Re: [sqlite] Unique Constraint Failed

2018-09-14 Thread Igor Korot
Hi, On Fri, Sep 14, 2018 at 3:14 PM Andrew Stewart wrote: > > Hi all, > I realize that this is the constraint that is failing. The > data is very large, encrypted and at a customer's site - not easy to use an > external program to view or to transfer to my office. > >

[sqlite] Unique Constraint Failed

2018-09-14 Thread Andrew Stewart
Hi all, I realize that this is the constraint that is failing. The data is very large, encrypted and at a customer's site - not easy to use an external program to view or to transfer to my office. What I am wondering is if there are any limits on the Unique

Re: [sqlite] Unique Constraint Failed

2018-09-14 Thread Simon Slavin
On 14 Sep 2018, at 8:56pm, Andrew Stewart wrote: > CREATE TABLE dataStreamRecord ( > fwParameterID INTEGER NOT NULL, > dateTime INTEGER NOT NULL, > data INTEGER NOT NULL, > UNIQUE ( > fwParameterID, > dateTime > ) > ); Well, there is only one UNIQUE

[sqlite] Unique Constraint Failed

2018-09-14 Thread Andrew Stewart
Hi Simon, I am having a problem receiving the emails and therefore cannot do this as a reply to the message. I am seeing your responses on the forum site. Below is the DDL for creating the table. It should not be possible for 2 elements to have the same

Re: [sqlite] Unique Constraint Failed

2018-09-14 Thread Simon Slavin
On 14 Sep 2018, at 8:29pm, Andrew Stewart wrote: >I am having problems with a database reporting Unique > Constraint Failed when doing an insert. > Table consists of 3 columns: > ID, DateTime, data > Constraint is on ID,DateTime. > >DateTime trying to enter is

[sqlite] Unique Constraint Failed

2018-09-14 Thread Andrew Stewart
Hi, I am having problems with a database reporting Unique Constraint Failed when doing an insert. Table consists of 3 columns: ID, DateTime, data Constraint is on ID,DateTime. DateTime trying to enter is current time. File is 200+ GB.

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-15 Thread R.Smith
On 2015-09-14 09:04 PM, Petr L?z?ovsk? wrote: > Have following table: > > CREATE TABLE ip_addr > ( > /*! Person identificator (PID) %%a */ pid INTEGER PRIMARY KEY NOT NULL, > /*! IP address %%b */ ip_addr VARCHAR (16) NOT NULL, > /*! Status: 0 - Allowed, Unassigned to specific customer (blocked)

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-15 Thread Petr Lázňovský
Thay track all of us and "optimalise" search results. My list of links could differ from yours. I have googled key phrase '"UNIQUE constraint failed:" sqlite primary key' and similar, but not read whole received documents, perform only brief look on it. This is best practice by my experience,

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-14 Thread Martin Engelschalk
Hi Petr, if you Google for "database table primary key" the first few results lead to quite good explanations. Also, the english wikipedia's article "Unique key" explains primary keys. HTH Martin Am 14.09.2015 22:25 schrieb Petr L?z?ovsk? : > > I had googled to verify such idea before, but

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-14 Thread Petr Lázňovský
I had googled to verify such idea before, but have no luck. Thanks, L. > Hello Petr, > defining the column pid as INTEGER PRIMARY KEY you added an implicit > contraint; a primary key means that only one record with a given value > of pid can exist in the table. > See

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-14 Thread Martin Engelschalk
Hello Petr, defining the column pid as INTEGER PRIMARY KEY you added an implicit contraint; a primary key means that only one record with a given value of pid can exist in the table. See https://www.sqlite.org/lang_createtable.html#rowid Martin Am 14.09.2015 um 21:04 schrieb Petr L?z?ovsk?: >

[sqlite] UNIQUE constraint failed: ip_addr.pid

2015-09-14 Thread Petr Lázňovský
Have following table: CREATE TABLE ip_addr ( /*! Person identificator (PID) %%a */ pid INTEGER PRIMARY KEY NOT NULL, /*! IP address %%b */ ip_addr VARCHAR (16) NOT NULL, /*! Status: 0 - Allowed, Unassigned to specific customer (blocked) */ /*! Status: 1 - Allowed, Asigned to concrete customer */