[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread da...@andl.org
Locking mode: Is this documented anywhere? As I thought I said, it's a standalone program; run it to normal termination; then run it again. Single connection, no flags enabled at open (just the default). Yes, I've been using Process Explorer for at least 10 years, since it was at sysinternals.

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread da...@andl.org
Thanks for the summary. Could be a useful addition to the docs. 1) single user. 2) I'm not 'using' anything. Just default open. 3) --> this could be it. How does this work exactly, and how do you avoid it/correct it (after the event)? 4) N/A 5) Latest download. 6) Windows 8.1 NTFS. 7) None. 8)

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Luuk
On 23-5-2015 18:41, Keith Medcalf wrote: > > You also lastly mention that the UUID fields are also used in the selection, > so the problem statement is really: > > Return the projection of Users and Perimeter_Notifications using the common > email field as the equijoin key, but return only the

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Rob Willett
Rich, I have lived and worked in New York and DC but not for too many years. I have fond memories of the eastern seaboard. I think you are correct with first, second and third passes on design. We?re into our second pass now. As we work through the issues we may redesign bits of it. However

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Rob Willett
Rich, Keith, Luuk, Thank you all for taking the time to write such cogent and helpful replies. I?ve tried out the ideas and they all work fine. We?ve also been looking at the design of our database and our logic to see if thats right. As I mentioned previously, I have feeling that this issue

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Rob Willett
Rich, Thanks. Simply writing the initial e-mail helped clarify things for me. We?re trying to work out the logic of setting holiday_mode to an explicit 0 rather than an assumed 0. Its not quite as simple as setting it in a table as its linked back to a mobile app and the synchronisation logic

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Rob Willett
Rich, Thanks. Simply writing the e-mail helped clarify things for me. We?re trying to work out the logic of setting holiday_mode to an explicit 0 rather than an assumed 0. Its not quite as simple as setting it in a table as its linked back to a mobile app and the synchronisation logic is a

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread Barry Smith
Hi, Unless you are using shared cache, SQLite does not lock on a per table level - only it locks the entire database. Under what circumstances are you trying to access the database both times? Are these multiple connections within the same process or are you shutting down the process and then

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Rob Willett
Hi, I?m trying to do some analysis across a couple of tables and the SQL is beyond my meagre skills. I?m struggling to even describe the problem to be honest. The high level description is that I have three tables, Users, Devices and Perimeter_Notifications. The high level description is that

[sqlite] How mature/stable is SQLite 4 now? ETA?

2015-05-23 Thread Mikael
SQLite4 looks neat! Last code commit was in September, is this because it's so stable or because other priorities took over? (https://sqlite.org/src4/tree?ci=trunk) Thanks! Mikael

[sqlite] Contentless FTS4 Tables

2015-05-23 Thread Dan Kennedy
On 05/23/2015 04:33 AM, ShadowMarta at yahoo.de wrote: > Hi! > > I have made a Contentless FTS4 Table like: > > "CREATE VIRTUAL TABLE if not exists OCR USING fts4(content="", `FullOCR` > varchar;" > > And managed to insert some data into it. > > I have 2 questions: > > 1.) How to get the proper

[sqlite] How mature/stable is SQLite 4 now? ETA?

2015-05-23 Thread Stephen Chrzanowski
SQLite4 is a dev "toy". It isn't going to be released any time soon. On Sat, May 23, 2015 at 6:09 AM, Mikael wrote: > SQLite4 looks neat! > > Last code commit was in September, is this because it's so stable or > because other priorities took over? > > (https://sqlite.org/src4/tree?ci=trunk) >

[sqlite] NOT EXISTS and LEFT JOIN Performance problem

2015-05-23 Thread Clemens Ladisch
ShadowMarta at yahoo.de wrote: > CREATE VIRTUAL TABLE `OCR` using fts4 ( > `ID`integer primary key NOT NULL, This is not how FTS tables work. SQLite ignores pretty much anything except the column names; it does not matter whether you write PRIMARY KEY or NO KEY PLEASE. All

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread da...@andl.org
Question: Under what circumstances can a table be locked when the database is first opened? My program does: DROP TABLE IF EXISTS CREATE TABLE INSERT INTO (multiple times) SELECT * (for each row) Run it once and it works perfectly. Run it twice and the DROP TABLE triggers the error:

[sqlite] How mature/stable is SQLite 4 now? ETA?

2015-05-23 Thread Darren Duncan
More like It'll be out in time for Christmas, where the specific year isn't mentioned. -- Darren Duncan On 2015-05-23 11:09 AM, Mikael wrote: > This sounds like it means we'll have it 2.5-5 years then.. so 2018 maybe, > > Sounds about correct? :) > > > 2015-05-23 23:06 GMT+05:30 Stephen

[sqlite] Contentless FTS4 Tables

2015-05-23 Thread shadowma...@yahoo.de
Hello Dan, sorry it is just like: CREATE VIRTUAL TABLE if not exists OCR USING fts4(content="", `FullOCR`); & CREATE TABLE `ART` ( `ID`integer NOT NULL, `Kundennummer`integer, `Rechnungsnummer`varchar, `Rechnungsdatum`datetime, `PDF`varchar, PRIMARY

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Rich Shepard
On Sat, 23 May 2015, Rob Willett wrote: > Thanks again and as its Saturday have a drink. If any of you are near York > in England I?ll happily buy you a pint. Rob, I'm in the upper left corner of the US so I'll have to pass on your kind offer. Germane to your fundamental concern, over

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Keith Medcalf
You also lastly mention that the UUID fields are also used in the selection, so the problem statement is really: Return the projection of Users and Perimeter_Notifications using the common email field as the equijoin key, but return only the results where there is not a Devices record with

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Keith Medcalf
To re-phrase your problem statement: Join the table Users and Perimeter_Notifications using the common email field and return the results as long as there does not exist a Devices record where Holiday_Mode is 1 for that Users email. Which translates directly to: SELECT * FROM Users,

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Rich Shepard
On Sat, 23 May 2015, Rob Willett wrote: > What I want to do is join the table Users and Perimeter Notifications > together but only if the value of Devices.Holiday_Mode is either non > existent or if Devices.Holiday_Mode does exist and its 0. If > Devices.Holiday_Mode is 1 it means the user is on

[sqlite] Under what circumstances can a table be locked when the database is first opened?

2015-05-23 Thread Simon Slavin
On 23 May 2015, at 4:13am, david at andl.org wrote: > Run it once and it works perfectly. Run it twice and the DROP TABLE triggers > the error: > > SQLITE_LOCKED, database table is locked I suspect Keith has it right. To help you figure out which of his options is right, Run it once. Stay

[sqlite] NOT EXISTS and LEFT JOIN Performance problem

2015-05-23 Thread shadowma...@yahoo.de
Hello! Sorry if this report shows up as a duplicate but didn?t figure out jet why some of my emails not showing up or getting rejected. This is my first "bug" report here so please bear with me for blunders. Using: ?sqlite-amalgamation-3081002.zip? Build as: ?cl sqlite3.c -O2

[sqlite] Contentless FTS4 Tables

2015-05-23 Thread shadowma...@yahoo.de
Hi! I have made a Contentless FTS4 Table like: "CREATE VIRTUAL TABLE if not exists OCR USING fts4(content="", `FullOCR` varchar;" And managed to insert some data into it. I have 2 questions: 1.) How to get the proper COUNT on the table ? The only query seems to work is: "SELECT