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] [SQLITE]select from a table and use its data to select from another one

2018-09-14 Thread Rob Richardson
Double quotes can be used to specify that you mean a database object when the name of the object might be confused with a keyword. For example, my company's database models a production system with various recipes. We call them "cycles". But the word "cycle" appears to have some specific

Re: [sqlite] [SQLITE]select from a table and use its data to select from another one

2018-09-14 Thread Rob Richardson
The use of single quotes instead of double quotes in database queries is not limited to SQLite. That's part of the SQL standard. RobR On Fri, Sep 14, 2018 at 2:05 PM David Raymond wrote: > Small typo: > > SELECT * FROM table2 JOIN table1 > ON table1.rowid = table2.rowid > WHERE

Re: [sqlite] Unique Constraint Failed

2018-09-14 Thread Keith Medcalf
Change is not likely. Putting a "UNIQUE" constraint is syntactic sugar for creating a unique index. That is CREATE TABLE dataStreamRecord ( fwParameterID INTEGER NOT NULL, dateTime INTEGER NOT NULL, data INTEGER NOT NULL, UNIQUE (fwParameterID, dateTime) ); is merely an

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.

Re: [sqlite] [SQLITE]select from a table and use its data to select from another one

2018-09-14 Thread Keith Medcalf
If you ONLY want columns returned from table2 then: select table2.* from table2 join table1 on table2.rowid = table1.rowid where table1.name like '%smth%'; which is really the same thing as: select table2.* from table2, table1 where table2.rowid = table1.rowid and table1.name

Re: [sqlite] [SQLITE]select from a table and use its data to select from another one

2018-09-14 Thread Maziar Parsijani
Hi, Thanks for your answer.I used your answer like this : SELECT * FROM table2 JOIN table1 on table1.rowid = table2.rowid WHERE table1.name LIKE '%smth%' Because without the "table1 on" statement it didn't work . On Fri, Sep 14, 2018 at 10:29 PM Simon Slavin wrote: > On 14 Sep

Re: [sqlite] [SQLITE]select from a table and use its data to select from another one

2018-09-14 Thread David Raymond
Small typo: SELECT * FROM table2 JOIN table1 ON table1.rowid = table2.rowid WHERE table1.name LIKE '%smth%' -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Friday, September 14, 2018 1:59 PM To: SQLite

Re: [sqlite] [SQLITE]select from a table and use its data to select from another one

2018-09-14 Thread Simon Slavin
On 14 Sep 2018, at 6:50pm, Maziar Parsijani wrote: > I have 2 tables with the same rowid now I want to : > select rowid from table1 where table1 like "%smth%" > select * from table2 where rowid =(selected rows before) > > I mean if I could do it in a same query. This is what JOIN is for.

[sqlite] [SQLITE]select from a table and use its data to select from another one

2018-09-14 Thread Maziar Parsijani
Hi, I have 2 tables with the same rowid now I want to : select rowid from table1 where table1 like "%smth%" select * from table2 where rowid =(selected rows before) I mean if I could do it in a same query. ___ sqlite-users mailing list

[sqlite] docs: application_id is signed, not unsigned

2018-09-14 Thread William Chargin
The docs for "PRAGMA application_id" read: > The application_id PRAGMA is used to query or set the 32-bit unsigned > big-endian "Application ID" integer located at [...]. However, it appears that the argument to this pragma is interpreted as a _signed_ integer, not an unsigned integer. In