[sqlite] How does _exec() do a transaction ?

2018-05-30 Thread Simon Slavin
Suppose I have no transaction open, and use _exec() with a multi-command string that has no transaction commands in. Does SQLite perform the whole _exec() in one transaction or each command in a separate transaction ? Simon. ___ sqlite-users mailing

Re: [sqlite] SQLite is a LoC Preferred Format for datasets

2018-05-30 Thread Scott Robison
On Wed, May 30, 2018 at 12:15 PM, dmp wrote: > DROP TABLE IF EXISTS mySinkDBTable; > CREATE TABLE mySinkDBTable ( > key_id1 INTEGER UNSIGNED NOT NULL, > key_id2 INTEGER UNSIGNED NOT NULL, > text VARCHAR > ); > > -- > -- Dumping data for table mySinkDBTable > -- > > INSERT INTO

Re: [sqlite] SQLite is a LoC Preferred Format for datasets

2018-05-30 Thread dmp
Suppose outside the subject of this thread, but in the document. Sustainability factors Self-documentation: "The database format incorporates technical and structural metadata needed to interpret and manipulate the data itself. For example, a database file will include the CREATE TABLE

Re: [sqlite] Congratulations on 18 years

2018-05-30 Thread jungle Boogie
On 30 May 2018 at 03:27, Christian Schmitz wrote: > Hello, > > Congratulations to the SQLite team. > > As far as I see, the first checkin was 2000-05-29, which was over 18 years > ago. Way to go! What a truly awesome project this has been! > > Sincerely > Christian >

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-30 Thread Vladimir Vissoultchev
> By the way, this feature is documented for ORDER BY, but I don't see it for > GROUP BY. It's not standard for GROUP BY e.g. SQL Server does not support it (ORDER BY col indexes are fine there too) At least sqlite does not support the abomination GROUP BY 1 DESC the way MySQL does. cheers,

Re: [sqlite] How does _exec() do a transaction ?

2018-05-30 Thread R Smith
On 2018/05/30 3:33 PM, Simon Slavin wrote: On 30 May 2018, at 2:30pm, Simon Slavin wrote: Does SQLite perform the whole _exec() in one transaction or each command in a separate transaction ? Subsidiary question: Does SQLite parse the entire string of commands for a syntax error first,

Re: [sqlite] [EXTERNAL] Re: database locked on select

2018-05-30 Thread Keith Medcalf
In this case it makes no real difference. The select on the connection will start a "read" transaction and the update on that connection will upgrade the transaction to a "write" transaction. The transaction will complete when both the select and the update(s) are complete and the select

Re: [sqlite] How does _exec() do a transaction ?

2018-05-30 Thread Simon Slavin
On 30 May 2018, at 3:07pm, Abroży Nieprzełoży wrote: > sqlite3_exec doesn't open transaction by itself. > > Each statement is prepared and executed separately. Thank you for your fast answers. Simon. ___ sqlite-users mailing list

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-30 Thread Mark Brand
Thanks for the clarification. You have constant integers, output column identifiers and "any other expression" as terms for GROUP BY. Just to make sure I'm not missing something subtle: I understand the "constant integer" is what gets interpreted as a result column number.  What is an

Re: [sqlite] How does _exec() do a transaction ?

2018-05-30 Thread Abroży Nieprzełoży
sqlite3_exec doesn't open transaction by itself. Each statement is prepared and executed separately. 2018-05-30 15:33 GMT+02:00, Simon Slavin : > On 30 May 2018, at 2:30pm, Simon Slavin wrote: > >> Does SQLite perform the whole _exec() in one transaction or each command >> in a separate

Re: [sqlite] How does _exec() do a transaction ?

2018-05-30 Thread Simon Slavin
On 30 May 2018, at 2:30pm, Simon Slavin wrote: > Does SQLite perform the whole _exec() in one transaction or each command in a > separate transaction ? Subsidiary question: Does SQLite parse the entire string of commands for a syntax error first, triggering an error if anything is wrong

[sqlite] How does _exec() do a transaction ?

2018-05-30 Thread Simon Slavin
Suppose I have no transaction open, and use _exec() with a multi-command string that has no transaction commands in. Does SQLite perform the whole _exec() in one transaction or each command in a separate transaction ? Simon. ___ sqlite-users mailing

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-30 Thread Hick Gunter
You have constant integers, output column identifiers and "any other expression" as terms for GROUP BY. If the expression evalutes to a constant value, you will have only one output row. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im

[sqlite] Congratulations on 18 years

2018-05-30 Thread Christian Schmitz
Hello, Congratulations to the SQLite team. As far as I see, the first checkin was 2000-05-29, which was over 18 years ago. Sincerely Christian -- Read our blog about news on our plugins: http://www.mbsplugins.de/ ___ sqlite-users mailing list

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-30 Thread Mark Brand
Thanks. I had forgotten that GROUP BY considers a literal integer in this context to be a column number, a feature I don't use. These, on the other hand, work as I would have expected: sqlite> select 0 group by cast (0 as int); 0 sqlite> select 0 group by (select 0); 0 Mark On 30/05/18

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-30 Thread Hick Gunter
Yes. If the expression is a constant integer K, then it is considered an alias for the K-th column of the result set. Columns are ordered from left to right starting with 1. There is no 0-th column, so GROUP BY 0 is "out of range", just the same as "SELECT 0 GROUP BY 31" would be.

Re: [sqlite] [EXTERNAL] Re: database locked on select

2018-05-30 Thread Paul Sanderson
If you are doing each update in a separate transaction it will be much slower than wrapping them in a single transaction. See the faq here, it refers to inserts but updates will be the same. http://sqlite.org/faq.html#q19 Cheers Paul On Wed, 30 May 2018 at 09:34, Torsten Curdt wrote: > >

[sqlite] unexpected error with "GROUP BY 0"

2018-05-30 Thread Mark Brand
Hi, Is there a good reason for this error: sqlite> SELECT  0 GROUP BY 0; Error: 1st GROUP BY term out of range - should be between 1 and 1 sqlite> SELECT 0 GROUP BY 1; 0 ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] [EXTERNAL] Re: database locked on select

2018-05-30 Thread Torsten Curdt
> Do the select and updates run inside a explicit transaction or they > run in individual implicit transactions? > implicit - does that make a big difference in this case? If you really want a single query you could write something like: > > WITH data(id, c1, c2 /*, ... */) AS (VALUES >