Re: [sqlite] Bug in SQLite version 3.31.1 and 3.32?

2020-03-06 Thread R.Smith
On 2020/03/07 03:52, Xinyue Chen wrote: Hi, If I change IS NOT FALSE to IS TRUE, the results will be different. I assume they should perform in the same way? if you say "NULL IS NOT FALSE" is always true, then 'NULL IS TRUE' should also be always true. Then why doesn't that query also return 4

Re: [sqlite] Sql update script. check for existing rows before inserting...

2020-02-23 Thread R.Smith
Send-before-checking failure. :) Corrections to my previous mail: 1. "... is to check in my code if the table exists" must read: "... is to check in my code if the table is empty" 2. "...ON CONFLICT DO UPDATESET (Antenna..." must read: "...ON CONFLICT DO UPDATE  SET (Antenna..."

Re: [sqlite] Sql update script. check for existing rows before inserting...

2020-02-23 Thread R.Smith
On 2020/02/24 06:17, Andy KU7T wrote: Hi, I would like to write a script that checks whether certain records already exist, and if not, insert them. If they do exist, it should be a no op. I am trying this: IF (SELECT COUNT(*) FROM [Antennas]) = 0 BEGIN /* Table data [Antennas] Record

Re: [sqlite] Performance Issue on Large Table

2020-02-23 Thread R.Smith
On 2020/02/23 21:23, Richard Damon wrote: On 2/23/20 8:31 AM, Olaf Schmidt wrote: An amount of 140 tables in such a "BibleVersions.db" is not uncommon and can be managed by SQLite in a good performance. I'm not sure that form of division would be good. One basic rule of database

[sqlite] Problem with locked database

2015-11-03 Thread R.Smith
On 2015-11-03 06:31 PM, ALBERT Aur?lien wrote: > Hi, > > I'm often getting the "Database is locked" error message and I don't really > understand what can lead to this. > > I'm using these settings : >- sqlite3_config(SQLITE_CONFIG_MULTITHREAD) >- multiple threads >- only one sqlite

[sqlite] how to empty a table with sqliteEstudio-2.0.26

2015-11-03 Thread R.Smith
On 2015-11-03 05:36 AM, Simon Slavin wrote: > On 3 Nov 2015, at 3:23am, H?ctor Fiandor wrote: > >> I have obtained the sqliteEstudio-2.0.26 and I need to empty a table. Is >> possible with this program? If not, how to do? > I have no idea how that program works. It is not SQLite, it is a

[sqlite] from hfiandor about a unit in spanish

2015-10-22 Thread R.Smith
Hi Hector, You can just copy-paste the unit code here - we'll have a look, but it's best to write a set of SQL statements that can be run in any SQLite application (such as the sqlite3.exe command line interface) and see whether that too doesn't work right, and if it doesn't, then we have a

[sqlite] Problems making sqlite.lib using Embarcadero C++ 7.00

2015-10-22 Thread R.Smith
On 2015-10-22 11:01 AM, Marco Turco wrote: > Hi all, > > I'm trying to generate the sqlite3 library but there is no way with > Embercadero C++ 7.00. > > I always receive some warnings and the first two related to the > _endthreadex' and '_beginthreadex' cannot permit to link me the library. > >

[sqlite] sqlite window functions extension?

2015-10-15 Thread R.Smith
On 2015-10-14 11:20 PM, Don V Nielsen wrote: > X has columns zip & crrt, just like crrt_net_non. These form a composite > key identifying groups within x. A value "53001.R501" would be an > example...53001 being the zip code and R501 being the carrier route. There > are 52 rows in X that have

[sqlite] crash

2015-10-12 Thread R.Smith
On 2015-10-12 07:40 PM, Richard Hipp wrote: > On 10/12/15, R.Smith wrote: >> More explicitly - would these be valid queries: >> >> SELECT props.* >> FROM ( >> SELECT 1 as id, JSON_OBJECT('i',5,'n','James') AS obj UNION ALL >> SELECT 2,

[sqlite] crash

2015-10-12 Thread R.Smith
On 2015-10-12 04:05 PM, Richard Hipp wrote: > On 10/12/15, R.Smith wrote: >> Two questions - >> 1 - would referencing a table alias formed from a table in the same FROM >> clause be valid in future? Or is this just for JSON purposes? >> >> 2 - would this be

[sqlite] crash

2015-10-12 Thread R.Smith
This posted in response to a bug notification on the dev list, but I moved it here for a question: On 2015-10-11 12:45 PM, Richard Hipp wrote: > On 10/11/15, Gilles Vollant wrote: >> I made a lot of very nice thing using json1, >> >> But I've an exception in the DLL just trying: >> >> CREATE

[sqlite] trying a recursive view with version 3.9.0

2015-10-11 Thread R.Smith
On 2015-10-11 05:23 PM, E.Pasma wrote: > 11 okt 2015, om 15:27, R.Smith: >> >> On 2015-10-11 03:14 PM, E.Pasma wrote: >>> Hello, >>> >>> One of the expected changes in 3..9.0 is: >>> A view may now reference undefined tables and functions when

[sqlite] trying a recursive view with version 3.9.0

2015-10-11 Thread R.Smith
On 2015-10-11 05:23 PM, E.Pasma wrote: > 11 okt 2015, om 15:27, R.Smith: >> >> On 2015-10-11 03:14 PM, E.Pasma wrote: >>> Hello, >>> >>> One of the expected changes in 3..9.0 is: >>> A view may now reference undefined tables and functions when

[sqlite] trying a recursive view with version 3.9.0

2015-10-11 Thread R.Smith
On 2015-10-11 03:14 PM, E.Pasma wrote: > Hello, > > One of the expected changes in 3..9.0 is: > A view may now reference undefined tables and functions when initially > created. Missing tables and functions are reported when the VIEW is > used in a query. > I could not resist trying a

[sqlite] Can this be done in SQLite?

2015-10-09 Thread R.Smith
On 2015-10-09 12:55 AM, K. P. wrote: > Brilliant - thanks.Though I still do not understand my > errordistinct(t.LastName || ', ' || t.FirstName),Seems to me that I am > passing a single argument in parentheses to distinct You had a separator (DISTINCT .. , '; ') as a second

[sqlite] Can this be done in SQLite?

2015-10-09 Thread R.Smith
On 2015-10-09 12:22 AM, K. P. wrote: > I tried this, of course, before asking, but: > group_concat(distinct(t.LastName || ', ' || t.FirstName), '; ') As Teachers, > gives > [15:19:32] Error while executing SQL query on database 'test': DISTINCT > aggregates must have exactly one argument As

[sqlite] Can this be done in SQLite?

2015-10-09 Thread R.Smith
On 2015-10-08 11:47 PM, K. P. wrote: > Am using SQLiteStudio - which I really like - though I have wondered if it > passes all its knowledge around errors onto the user... I hope it does. Try some other ones too, just to get a wider idea. Perhaps http://www.sqlc.rifin.co.za/ or

[sqlite] Can this be done in SQLite?

2015-10-09 Thread R.Smith
On 2015-10-08 11:30 PM, K. P. wrote: > It does indeed work - had to make myself a simpler query than the real life > one to see this. I probably had some other syntax error that I mistook for > it... > Thanks! Nice. Are you logging the SQLite errors and error descriptions? It's usually quite

[sqlite] Can this be done in SQLite?

2015-10-09 Thread R.Smith
On 2015-10-08 10:54 PM, K. P. wrote: > Thanks for that.I'd need something along the lines of > > group_concat(c.LastName || ', ' || c.FirstName, ';') as ClientName, > > > which in itself does not seem to be supported. This would be quite a normal group concatenation and works perfectly well...

[sqlite] version 3.9.0 doc errors

2015-10-08 Thread R.Smith
*** Correction *** On 2015-10-08 10:03 PM, R.Smith wrote: > > To clarify, when used as an adverb to modify a verb, you may well add > the s - such as saying "I'm moving backwards" or "It's a forwards > marching army."//... "Marching" is of course

[sqlite] version 3.9.0 doc errors

2015-10-08 Thread R.Smith
On 2015-10-08 08:58 PM, Donald Griggs wrote: > Regarding: >2nd paragraph - The New Version Numbering System (auxiliary letter): > "The second number Y is incremented for any change that breaks forward*s* > compatibility..." > > Not that it matters much, but in general it seems that adding

[sqlite] version 3.9.0 doc errors

2015-10-08 Thread R.Smith
More draft doc errors: https://www.sqlite.org/draft/versionnumbers.html 1st paragraph - SQLite Version Numbers (typo for "through"): "There are two strategies for version numbers in SQLite. The historical system, in use from the first release on 2000-08-17 *though* version 3.8.11.1 on..."

[sqlite] [sqlite-dev] Proposed new version numbering scheme for SQLite - Feedback requested

2015-10-08 Thread R.Smith
On 2015-10-08 06:21 PM, Richard Hipp wrote: > It all really boils down to this: What is the difference between a > "major" and a "minor" change? > Agreed, and the decision between whether an item is major or minor is always going to be a blurred line. It is not important for the issue at

[sqlite] version 3.8.12 doc errors

2015-10-08 Thread R.Smith
Documentation errors: https://www.sqlite.org/draft/vtab.html#epovtab In the 1.1.2 Eponymous virtual tables section (auxiliary word): "Note that SQLite versions prior to 3.8.12 did not check the xCreate method for NULL *before to* invoking it..." ---

[sqlite] SQLite version 3.8.12 enters testing

2015-10-08 Thread R.Smith
Some notes on 3.8.12: (Brilliant release btw, thanks) I've been following the thread about the version numbering, and at first thought the OP was a little over-enthusiastic about increasing version numbers prematurely, but then after reading the release notes, I have to agree to some extent -

[sqlite] obtain a copy of a table

2015-10-06 Thread R.Smith
On 2015-10-06 04:52 PM, H?ctor Fiandor wrote: > Dear fellows: > > > > I handle my applictions with Lazarus and use BD as sqlite. Sometimes I have > to obtain a copy of an sqlite table and now I use the method of read and > write, but I want to know if exists and SQL command that do the same

[sqlite] Ideas on how to use backup API for remote, incremental backup?

2015-10-06 Thread R.Smith
Well, there's the obvious Elephant in the room - SQL. You could just reduce any DB to SQL statements and pass those along at whichever pace/destination/byte-mode you fancy. The target system will have zero trouble turning it into a DB, thanks to the SQLite engine already able to parse SQL.

[sqlite] How do i submit a bug?

2015-10-05 Thread R.Smith
On 2015-10-05 12:22 AM, Jacob wrote: > Hi, I have discovered a bug, or at least inconsistancy with documantation, > > DO i submit the bug through this mailing list, or is there a ticket system? This is the place to post it. Some of the people here will look into it and if it is found to be a

[sqlite] (no subject)

2015-10-03 Thread R.Smith
On 2015-10-03 01:51 PM, Dan Kennedy wrote: > > Ok. My first guess is that you are missing the "suggested index" on > the child table. Without this, if there is a foreign key violation in > the db, each insert on the parent table will cause a linear scan of > the entire child table. With the

[sqlite] Speed of count distinct rows if unique index on all fields

2015-10-02 Thread R.Smith
On 2015-10-02 07:28 PM, Bart Smissaert wrote: >> if any single column in those two rows is NULL. > OK, I got it and that will make it even less likely that this situation > will occur. > I think we got this exhausted now. Sure - but don't be dismayed though, every opportunity for optimization

[sqlite] Speed of count distinct rows if unique index on all fields

2015-10-02 Thread R.Smith
On 2015-10-02 05:41 PM, Bart Smissaert wrote: >> you're just throwing random terms around and hoping something sticks. > Not sure where you got that idea from, but let me explain better: > > Say we have a table: > > CREATE TABLE TABLE1 > ([FIELD1] INTEGER, > [FIELD2] TEXT, > [FIELD3] TEXT, >

[sqlite] Speed of count distinct rows if unique index on all fields

2015-10-02 Thread R.Smith
On 2015-10-02 10:05 AM, Bart Smissaert wrote: > Noticed that if I have table with a unique index on all fields, counting > all rows is still a lot faster > (about a factor 10 on my particular test table) than counting distinct rows. > Could maybe an optimization be added to SQLite to speed this

[sqlite] Best Practices

2015-10-01 Thread R.Smith
On 2015-10-01 01:08 AM, eluken at pentarch.org wrote: > Well, when you put it like that :) > > I might allow the user to change the name based on the game name. But > there again, special characters. Ideally, the functionality would > allow for multiple databases. > > I also need to figure

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread R.Smith
On 2015-09-30 12:31 PM, Deepak Hegde wrote: > On Wednesday 30 September 2015 03:30 PM, R.Smith wrote: >> >> On 2015-09-30 11:46 AM, Deepak Hegde wrote: >>> Hi All, >>> >>> I have a to copy entry from on database to another which have the >>>

[sqlite] [Sqlite] Insert statement execution takes more time as DB entries increases.

2015-09-30 Thread R.Smith
On 2015-09-30 11:46 AM, Deepak Hegde wrote: > Hi All, > > I have a to copy entry from on database to another which have the > similar structure. > > So I am using the method of ATTACH the DB and INSERT statement to insert > the 200 entries at a time. > I have observed that as the entries in the

[sqlite] Creating a stable database

2015-09-28 Thread R.Smith
On 2015-09-28 11:30 AM, Aaron Digulla wrote: > > Am Freitag, 25. September 2015 20:46 CEST, Warren Young > schrieb: > >> >> That suggests a good test for Aaron, then: >> >> sqlite3 my.db .dump > dump.sql >> sqlite3 a.db < dump.sql >> sqlite3 b.db < dump.sql > Thank you

[sqlite] Creating a stable database

2015-09-25 Thread R.Smith
On 2015-09-25 08:46 PM, Warren Young wrote: > On Sep 25, 2015, at 11:59 AM, Richard Hipp wrote: >> On 9/25/15, Aaron Digulla wrote: >>> I was wondering if it was possible to create the same database (= no binary >>> difference) twice with sqlite. >> It works fine to create identical database

[sqlite] Detect if db is already opened by another process?

2015-09-23 Thread R.Smith
On 2015-09-23 06:09 PM, Richard Hipp wrote: > On 9/23/15, Michael Schlenker wrote: >> Hi, >> >> i just wondered if there is an API to detect if a sqlite database file >> is already opened by another process. > Maybe try to change in or out of WAL mode? That only works if there > is a single

[sqlite] get the data anyway no matter what the entry of the second table is existing or not

2015-09-23 Thread R.Smith
On 2015-09-22 11:17 PM, ChingChang Hsiao wrote: > SELECT * FROM service_table AS a > LEFT JOIN service_fib_table AS b ON a.service_no=b.service_no ; > > > How about adding one more further conditional JOIN in one statement above. > > service_fib_table.fib_id=service_fib_port_table.fib_id > > It

[sqlite] get the data anyway no matter what the entry of the second table is existing or not

2015-09-23 Thread R.Smith
On 2015-09-22 11:17 PM, ChingChang Hsiao wrote: > SELECT * FROM service_table AS a > LEFT JOIN service_fib_table AS b ON a.service_no=b.service_no ; > > > How about adding one more further conditional JOIN in one statement above. > > service_fib_table.fib_id=service_fib_port_table.fib_id > > It

[sqlite] UPDATE silently failing

2015-09-22 Thread R.Smith
On 2015-09-22 03:58 PM, Hugues Bruant wrote: > On Tue, Sep 22, 2015 at 6:22 AM, Richard Hipp wrote: > >> On 9/22/15, Hugues Bruant wrote: If you can capture a malfunctioning trace, and send in the database file and the SQL statement that is running, that should allow us to

[sqlite] UPDATE silently failing

2015-09-22 Thread R.Smith
On 2015-09-22 06:37 AM, Hugues Bruant wrote: >> If you can capture a malfunctioning trace, and send in the database >> file and the SQL statement that is running, that should allow us to >> localize the problem. >> > Trace for the failing UPDATE: > > cv_s=1 > cv_o=b8b9f4... > cv_t=28 -> 29 > >

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-22 Thread R.Smith
On 2015-09-22 04:36 AM, James K. Lowden wrote: > On Mon, 21 Sep 2015 11:19:16 +0200 > "R.Smith" wrote: > >> >> This is the entire point of a database - allowing multiple things to >> see the data. A system which only allows one thread t

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-21 Thread R.Smith
On 2015-09-21 11:18 AM, Rowan Worth wrote: > On 21 September 2015 at 16:36, Simon Slavin wrote: > >> On 21 Sep 2015, at 8:29am, Rowan Worth wrote: >> >>> 1) Statement is prepared >>> 2) Statement is stepped >>> 3) Statement is reset >>> 4) ... time passes ... >>> 5) Statement is stepped >>> 6)

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-21 Thread R.Smith
On 2015-09-21 01:53 AM, Nicolas J?ger wrote: > hi, > > > Scott Robison wrote: > >> 3. Some time passes and some external process may alter the schema. >> > is it really possible ? if the answer is yes (I thought when a process open a > communication with > the DB, other processes can't alter

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-19 Thread R.Smith
On 2015-09-19 06:41 PM, gwenn wrote: > SQLITE_SCHEMA is returned only on failure. > But, here, there is not failure. > > Maybe I should not store the column count ? > Maybe I should look at schema version > (http://sqlite.org/pragma.html#pragma_schema_version): > "The schema version is used by

[sqlite] I don't understand how to use NOT EXISTS

2015-09-18 Thread R.Smith
On 2015-09-18 03:13 AM, Keith Medcalf wrote: >> Some initial things. > >> Data needs to be kept in 1NF (or 1st-Normal-Form) which is relational >> theory speak for "Everything without a 1-to-1 relationship with the key >> field in a table, should be in another table". Many reasons for this >>

[sqlite] Handling the whole select query from an index

2015-09-18 Thread R.Smith
>>>Rob: "We want to do postal code ==> GPS..." >>Me: "You can use google apis..." >Rob: "Our business is GPS and GIS traffic data" Oops yes, that's a whole nother kettle of fish then. To return to some of the older parts of the conversation, I think the SQL route is best (whichever

[sqlite] Handling the whole select query from an index

2015-09-18 Thread R.Smith
On 2015-09-18 06:23 PM, Luuk wrote: > > > On 18-09-15 17:54, R.Smith wrote: >> >> As an aside, you know you can already do this via a Google API right? >> That is, you can find a GPS location for an address or approximate >> address (city & postal c

[sqlite] Handling the whole select query from an index

2015-09-18 Thread R.Smith
On 2015-09-18 08:17 AM, Rob Willett wrote: > What we wanted was a postcode to GPS lookup, it was not to pinpoint a house, > you would need a little more information to be that specific, e.,g. house > number or a name, but to get to a general area that has a central GPS point. As an aside, you

[sqlite] Nuget Sqlite Packages

2015-09-18 Thread R.Smith
On 2015-09-18 12:08 AM, Scott Robison wrote: > It does not help that this boilerplate code is automatically added to every > message through their corporation's mail servers, so it shows up whether or > not there is sensitive information to be protected. I often muse weird things late at night

[sqlite] Nuget Sqlite Packages

2015-09-17 Thread R.Smith
On 2015-09-17 07:19 PM, Jim Boyce wrote: > DISCLAIMER "This email and its attachments may contain privileged and/or > confidential information//... It might also not contain anything at all. :)

[sqlite] I don't understand how to use NOT EXISTS

2015-09-17 Thread R.Smith
On 2015-09-17 05:13 AM, Nicolas J?ger wrote: > @Ryan, >> To get you started on this road, may I ask you take a leap of faith >> and explain to us from A to Z what you would like to achieve with the >> tables and data you are asking about above - i.e don't show us the >> programming you think

[sqlite] Handling the whole select query from an index

2015-09-17 Thread R.Smith
On 2015-09-17 04:50 PM, John McKown wrote: > On Thu, Sep 17, 2015 at 9:41 AM, R.Smith wrote: > >> (11) This forum. Need help or suggestions with how to optimize your >> internal value-store? Not so easy. Need help optimizing an SQLite DB or >> query? We've all seen the

[sqlite] Handling the whole select query from an index

2015-09-17 Thread R.Smith
On 2015-09-17 02:22 PM, Richard Hipp wrote: > On 9/17/15, John McKown wrote: >> Well, this may be a heretical answer. > Yes, it is. > > There are a number of reasons to still use SQLite even if you are only > doing key/value lookups: > > (1) SQLite is the most widely deployed database engine in

[sqlite] I don't understand how to use NOT EXISTS

2015-09-17 Thread R.Smith
On 2015-09-16 08:27 PM, Nicolas J?ger wrote: > Hi guys, > > so there is the two ways I made: > > FIRST ONE: > == > > ** Create a table wich will store the result of EXISTS, > > CREATE TABLE _TAG_EXISTS_RESULT_( NAME, BOOL ); > > > ** The next query has to INSERT 'evil little sister' with

[sqlite] I don't understand how to use NOT EXISTS

2015-09-15 Thread R.Smith
On 2015-09-15 06:01 PM, Nicolas J?ger wrote: > hi Keith, hi others, > >> If there should only be one entry for each name (and it is not case >> sensitive), > I'm using sqlite trough a C++ program wich take care of the case > sensitive. In this very case, each entry has to be unique. Fine, but

[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] sqlite3 file as database

2015-09-14 Thread R.Smith
hat seems most common, it would just be the: "*.db" (Security-win, I know) For reference, I just checked this pc (as described above) and these are all the valid SQLite DB's in Appdata with their extensions: (Your experience may differ) C:\Users\R.Smith\AppData\Local\Adobe\OOBE\op

[sqlite] sqlite3 file as database

2015-09-14 Thread R.Smith
On 2015-09-14 04:07 PM, Drago, William @ CSG - NARDA-MITEQ wrote: > Why do people use .db3 for sqlite database files? In my experience .db3 is > the file extension for dBase III database files. Might I add here that if I re-read the OP's question, it might actually be that he had a DBIII file

[sqlite] Worked in 3.8.9, but now "recursive aggregate queries not supported"

2015-09-13 Thread R.Smith
On 2015-09-13 12:40 AM, Aurel Wisse wrote: > @R.Smith > I wasn't aware that recursive aggregate queries give wrong answers in 99% > of all general use cases//... I apologize - I thought Richard had made that much clear early on in the exchange and you were simply not recognizing or

[sqlite] Worked in 3.8.9, but now "recursive aggregate queries not supported"

2015-09-13 Thread R.Smith
On 2015-09-12 10:58 PM, Aurel Wisse wrote: > The fastest solution is actually the temporary table: Glad you found a faster solution. > Still Richard : How about allowing recursive aggregate queries again ? You say "allow" like it's something that worked and they blocked it out for no good

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-12 Thread R.Smith
On 2015-09-12 06:30 PM, Florian Weimer wrote: >> On 09/06/2015 11:13 AM, Florian Weimer wrote: >>> Surely that's not true, and NFS and SMB are fine as long as there >>> is no concurrent access? >> And no program crashes, no network glitches, no optimisation in the >> protocols to deal with

[sqlite] Feedback request: JSON support in SQLite

2015-09-11 Thread R.Smith
On 2015-09-11 07:50 PM, Keith Christian wrote: > Pardon me, but: At what point does the code required for the > inclusion of a multitude of supported data formats exceed the core > purpose of the executable? > > At some point, obtaining a desired output format (from the potentially > dozens

[sqlite] analyze

2015-09-11 Thread R.Smith
On 2015-09-10 09:05 AM, Ludovic Aubert wrote: > Hello, > > I am facing a strange issue: > I am calling sqlite3_execute(db, "ANALYZE;") from a C program after a bunch > of CREATE and INSERT, > Then this program exits. > Another exe tries to perform some selects into the db, but it seems like >

[sqlite] Using collation instead a virtual table

2015-09-09 Thread R.Smith
On 2015-09-09 09:02 PM, Constantine Yannakopoulos wrote: > On Wed, Sep 9, 2015 at 9:47 PM, R.Smith wrote: > >> On 2015-09-09 05:19 PM, Constantine Yannakopoulos wrote: >> >>> On Wed, Sep 9, 2015 at 4:54 PM, Igor Tandetnik >>> wrote: >>> >&g

[sqlite] Using collation instead a virtual table

2015-09-09 Thread R.Smith
On 2015-09-09 05:19 PM, Constantine Yannakopoulos wrote: > On Wed, Sep 9, 2015 at 4:54 PM, Igor Tandetnik wrote: > >> A comparison like this would not generally be a proper collation. The >> equivalence relation it induces is not transitive - it's possible to have A >> == B and B == C but A !=

[sqlite] BEGINNER - Transactions in shell script

2015-09-05 Thread R.Smith
On 2015-09-05 10:18 PM, Petr L?z?ovsk? wrote: > Have some shell scripts working with sqlite. Receiving incoming payments from > bank via HTTP API and pushing it into database. This script will start > periodically, every single hour. > > Want to prevent situation only few payments are written

[sqlite] Third test of json and index expressions, now it works

2015-09-05 Thread R.Smith
On 2015-09-05 08:58 PM, Domingo Alvarez Duarte wrote: > Hello ! > > Again your proposition doesn't stand up ! Again? That was my first post on the subject and it was in reply to Darko whom asked for a specific reason, so I supplied one. (Which by the way isn't to say I am 100% convinced by

[sqlite] Third test of json and index expressions, now it works

2015-09-05 Thread R.Smith
On 2015-09-05 08:07 PM, Darko Volaric wrote: > So my question remains: why not have this user friendly feature? What are > the motivations for not having it? Waste of CPU cycles punishing those users who stick to valid SQL for the sins of those who like shortcuts.

[sqlite] sqlite-users Digest, Vol 93, Issue 4

2015-09-04 Thread R.Smith
On 2015-09-04 06:09 PM, Peter Haworth wrote: > Thanks for the info. > > Could I get round the single value limitation with something like: > > IN ((SELECT 'abc','def' FROM myTable)) Maybe what you intend is more like this: IN (SELECT 'abc' UNION ALL SELECT 'def' UNION ALL SELECT 'ghi'... etc.)

[sqlite] combine SELECTs

2015-08-30 Thread R.Smith
On 2015-08-30 09:02 PM, Lev wrote: > Okay, it is more like an SQL question... > > So I have say three different SELECT on one table. I'd like to combine the > three to have data in the result, only if one particular field is the same for > each query. Might I suggest 2 approaches: (I'm just

[sqlite] order by not working in combination with random()

2015-08-28 Thread R.Smith
On 2015-08-28 04:45 PM, Rousselot, Richard A wrote: > I have noticed that SQLite Query Browser is running slower than other IDEs, > including SQLitespeed, for some reason. Even when each IDE is set to using > similar versions of the SQLite3.dll. We had a recursive query in SQB take 6 > min,

[sqlite] order by not working in combination with random()

2015-08-28 Thread R.Smith
On 2015-08-28 03:09 PM, Yahoo! Mail wrote: > Where did you see the vacuum happening inside the transaction? It's > just right before begin...anyway. It seems I'm unable to make clear > the actual "issue" of mine, but anyhow it's not a bit deal. I just > wanted to report what I have noticed,

[sqlite] order by not working in combination with random()

2015-08-28 Thread R.Smith
On 2015-08-28 01:17 PM, Yahoo! Mail wrote: > Obviously you did not get my issue; something is wrong and your timer > suggestion indicates this. During the execution of each command, I > would monitor it with *watch "du test.db*"*. The journal size would go > mad even surpassing the database's

[sqlite] Insertion into the large DB drastically slows down at some point

2015-08-28 Thread R.Smith
On 2015-08-28 04:15 AM, Yuri wrote: > I build a fairly large DB, with major tables having 800k..5M rows, > with several relationships between tables. > > At ~30% into the insertion process it slows down rapidly. Records > #171k..172k are still fast, and records #172k...173k are already ~10 >

[sqlite] order by not working in combination with random()

2015-08-27 Thread R.Smith
On 2015-08-27 04:50 PM, Scott Hess wrote: > I keep thinking I remember a thread from years ago where a lot of this was > hashed out, but I cannot find it. > //// > There is already some precedent for this, because ORDER BY RANDOM() must > internally be holding the random values used fixed

[sqlite] why I don't get an error ?

2015-08-27 Thread R.Smith
On 2015-08-27 04:06 PM, Nicolas J?ger wrote: > Hi Darko, Igor and others. > >so the only reason to define datatype in sqlite is for the size on >the disk ? > >so why not just only using `BLOB` (excepted for `INTEGER PRIMARY >KEY`) ? > >being less persmissive wouldn't make

[sqlite] order by not working in combination with random()

2015-08-27 Thread R.Smith
On 2015-08-27 03:29 PM, Simon Slavin wrote: > > Sure. I chose to use an alias just to emphasise how wrong the result looked. > However, I have seen code written by teams where the person writing the > query has no real idea whether they're querying a TABLE, a VIEW, or a virtual > table.

[sqlite] order by not working in combination with random()

2015-08-27 Thread R.Smith
On 2015-08-27 03:03 AM, James K. Lowden wrote: > On Wed, 26 Aug 2015 13:39:09 +0100 > Simon Slavin wrote: > >> On 26 Aug 2015, at 11:27am, tonyp at acm.org wrote: >> >>> Plus, it apparently recognizes if the random() expression in the >>> ORDER BY is the same as the SELECT one and again sort

[sqlite] WITH () AS (SELECT ) help

2015-08-26 Thread R.Smith
On 2015-08-26 05:12 AM, jose isaias cabrera wrote: > Greetings, perhaps this is not even possible... > > But I am trying to do something like this, > > WITH EmailData (name,contact,dstamp) AS > ( >SELECT > 'last, first', > 'first.last at xerox.com', > '2015-08-25 11:11:11' > ) > UPDATE

[sqlite] Why sqlite show qualified column names when selecting from views ?

2015-08-25 Thread R.Smith
On 2015-08-25 08:37 PM, Richard Hipp wrote: > On 8/25/15, Simon Slavin wrote: >> "If there is no AS clause then the name of the column is unspecified and may >> change from one release of SQLite to the next." >> > Heed this warning!!! > > And yet, there are countless tens of thousands of

[sqlite] PRAGMA cache_size and ATTACHED DBs

2015-08-24 Thread R.Smith
The cache size pragma dictates to (and affects) the connection, not the DB. So yes. On 2015-08-24 07:30 PM, jose i cabrera wrote: > > Greetings! > > When connecting to a DB, and setting a PRAGMA cache_size, will the > attached DB also respond/behave the same way/size set by the original >

[sqlite] SQlite database access over wireless network

2015-08-24 Thread R.Smith
On 2015-08-24 06:43 PM, Mike McWhinney wrote: > Hello, > I am trying to troubleshoot a problem that I'm having with a program > usingSQLite over a wireless network. I know that wireless networks can > havetheir own sets of issues that cause database access problems. > What is happening is

[sqlite] design problem involving trigger

2015-08-23 Thread R.Smith
On 2015-08-23 03:32 AM, Barry Smith wrote: > Could this not be achieved by two indexes: one partial and one complete? > > CREATE UNIQUE INDEX idx_books1 ON Books(title, author); > > CREATE UNIQUE INDEX idx_books2 ON Books(title) WHERE author ISNULL; > > To save space and (maybe) time, you could

[sqlite] DbFunctions.TruncateTime

2015-08-23 Thread R.Smith
On 2015-08-23 12:16 AM, Steffen Mangold wrote: > Hi Ryan, > > I get your point. :) > It seems the I was misunderstanding this help mailing list. I thought it's > also support for 'System.Data.SQLite'. > > In the way 'System.Data.SQLite' is an ADO.NET provider for SQLite and also > give support

[sqlite] : it seems to be only orber by and group

2015-08-23 Thread R.Smith
This will work great - just a correction, there should be a comma after "columnB" in the order by clause, else it might not parse, so the revised is: SELECT * FROM table ORDER BY columnA, columnB, CASE WHEN columnC = 1 THEN 0 ELSE 1 END; On 2015-08-22 10:47 PM,

[sqlite] DbFunctions.TruncateTime

2015-08-23 Thread R.Smith
On 2015-08-22 10:57 PM, Steffen Mangold wrote: >> how can I trunc time in EntityFramework? >> >> I tried it this way: >> >> model.Datas >> .GroupBy(d => >> DbFunctions.TruncateTime(d.TimeStamp)) >> .Select(d => d.Key.Value) >>

[sqlite] design problem involving trigger

2015-08-22 Thread R.Smith
On 2015-08-21 11:23 PM, Will Parsons wrote: > On 21 Aug 2015, R.Smith wrote: >> >> On 2015-08-21 04:47 AM, Will Parsons wrote: >>> I'm working on a program that involves a catalogue of books. Part of >>> the database schema looks like this: >>> >

[sqlite] There is any reason to sqlite not expand "*" in function calls ?

2015-08-22 Thread R.Smith
On 2015-08-22 11:42 AM, sqlite-mail wrote: > Hello ! > > I'm testing the new json functions and when I tried this: > > select json_array(*) as json from one_table; > > I've got : > > [] > > [] > > .. > > Then I tried with some custom functions accepting variable number of > parameters and

[sqlite] design problem involving trigger

2015-08-21 Thread R.Smith
On 2015-08-21 04:47 AM, Will Parsons wrote: > I'm working on a program that involves a catalogue of books. Part of > the database schema looks like this: > > create table Books(id integer primary key, > title text collate nocase not null, > author

[sqlite] When sqlite3_close() returns SQL_BUSY

2015-08-21 Thread R.Smith
Hi Jeff, On 2015-08-21 07:30 AM, Jeff M wrote: > Sometimes my iOS app creates an unreasonable number of prepared statements > (perhaps 1,000, an app bug that I'm fixing). These prepared statements are > later finalized just prior to doing sqlite3_close(), which sometimes returns > SQL_BUSY.

[sqlite] Getting row number in a sorted list.

2015-08-20 Thread R.Smith
On 2015-08-20 07:44 AM, Anthrathodiyil, Sabeel (S.) wrote: > Hi, > I think there is ambiguity in the example I provided, I wouldn't need a > ranking in my case as I need the offset (think row number is misleading) of > the first record in the sorted list. > > Here is my use case. > Find the

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread R.Smith
> > SELECT count(sub.Name) + 1 AS Rank, a.Name > FROM NameTable AS a LEFT OUTER JOIN NameTable AS sub ON sub.Name < > a.Name > WHERE a.Name LIKE 'P%' > GROUP BY a.Name > ORDER BY a.Name > LIMIT 1 > > > -- Rank | Name > -- | -- > -- 4 | PQRS I

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread R.Smith
On 2015-08-19 03:02 PM, John McKown wrote: > On Wed, Aug 19, 2015 at 7:40 AM, Simon Slavin wrote: > >> 1|ABCD >> 2|CDE >> 4|AXN >> 5|AXN2 >> 6|PQRS2 >> sqlite> select rowid from NameTable where Name between 'P' and 'PZZZ' >> limit 1; >> 6 >> >> >> Hum, that probably isn't what the OP

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread R.Smith
On 2015-08-19 02:40 PM, Simon Slavin wrote: > > SELECT rowid FROM NameTable > WHERE name BETWEEN 'P' AND 'P' > ORDER BY name > LIMIT 1 > > This will execute faster if you have an index on 'name' in NameTable. > > [Yes I know 'P' is lazy. Until you find someone with

[sqlite] Enhance the SELECT statement?

2015-08-17 Thread R.Smith
On 2015-08-17 08:15 PM, Petite Abeille wrote: >> On Aug 17, 2015, at 8:08 PM, R.Smith wrote: >> >> CORRECTION: It seems one of the two options I've mentioned earlier, namely >> the CREATE TABLE AS SELECT... does not actually work on the back of a WITH >> cla

[sqlite] Enhance the SELECT statement?

2015-08-17 Thread R.Smith
CORRECTION: It seems one of the two options I've mentioned earlier, namely the CREATE TABLE AS SELECT... does not actually work on the back of a WITH clause. The other option still do, but this request has more appeal now. On 2015-08-17 07:24 PM, R.Smith wrote: > > > On 2015-08-17

[sqlite] Boolean constraint regression between 3.7.7.1 and 3.8.6?

2015-08-17 Thread R.Smith
On 2015-08-17 06:08 PM, Olivier Barthelemy wrote: > OK, > I already had removed my constraint as it is, since it is obviously invalid > > So for me : > Am i right to leave a constraint, say CHECK (varname=0 OR varname=1), to > avoid other integer values, or is the constraint useless? (i guess

  1   2   3   >