Re: [sqlite] [EXTERNAL] What happens when a call contains two SQL statement

2018-07-08 Thread Hick Gunter
Only the "on conflict" clause -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Cecil Westerhof Gesendet: Montag, 09. Juli 2018 08:38 An: SQLite mailing list Betreff: Re: [sqlite] [EXTERNAL] What happens when a call contains

Re: [sqlite] [EXTERNAL] What happens when a call contains two SQL statement

2018-07-08 Thread Cecil Westerhof
2018-07-09 8:28 GMT+02:00 Hick Gunter : > Why should a failure in transaction #2 rollback transaction #1? > ​I was thinking that, but was not sure. I thought that maybe everything in a call would be seen as a transaction. But that is not the case then: every statement in a call is its own transac

Re: [sqlite] Use with Visual Studio

2018-07-08 Thread J Decker
there's also nuget package for sqlite which handles updates pretty well. (IMO) On Sun, Jul 8, 2018 at 11:13 PM Mike King wrote: > Same here. Again, I download it from the main system.data site. No problems > at all. > > Cheers > > On Mon, 9 Jul 2018 at 06:57, Chris Locke wrote: > > > I use syst

Re: [sqlite] [EXTERNAL] What happens when a call contains two SQL statement

2018-07-08 Thread Hick Gunter
Why should a failure in transaction #2 rollback transaction #1? If you want this behaviour, do "begin; delete ...; insert ... on conflict rollback; commit;" to make both statements run in one transaction -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglist

[sqlite] What happens when a call contains two SQL statement

2018-07-08 Thread Cecil Westerhof
I am working with Tcl. The best is of-course a general answer, but if it is depending on the used language I will be satisfied with the Tcl answer. ;-) Say I have the following code: set SQLCmd " DELETE FROM testing WHERE key = 12 ; INSERT INTO testing

Re: [sqlite] Use with Visual Studio

2018-07-08 Thread Mike King
Same here. Again, I download it from the main system.data site. No problems at all. Cheers On Mon, 9 Jul 2018 at 06:57, Chris Locke wrote: > I use system.data.sqlite.dll (taken from here: > https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki) > with no problems in both VS 201

Re: [sqlite] Use with Visual Studio

2018-07-08 Thread Chris Locke
I use system.data.sqlite.dll (taken from here: https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki) with no problems in both VS 2017 Professional and VS 2017 Community. Thanks, Chris On Mon, Jul 9, 2018 at 2:47 AM Roger Schlueter wrote: > I am considering using the .net vers

Re: [sqlite] Segfault when authorizer denies some steps of creating a WITHOUT ROWID table

2018-07-08 Thread Richard Hipp
Thanks for providing a succinct test case! A fix is now check-in on trunk. https://www.sqlite.org/src/info/164b1641e346994f Just FYI, the regression test case was added to TH3 (https://www.sqlite.org/th3.html) rather than in the main source tree as it is much easier to incorporate there. On 7/8

[sqlite] Use with Visual Studio

2018-07-08 Thread Roger Schlueter
I am considering using the .net version of SQLite but have two questions: 1. The documentation lists the versions of Visual Studio that are supported.  VS2017 is NOT listed.  Is VS2017 supported. 2. The documentation states "Due to Visual Studio licensing restrictions, the Express Editions

[sqlite] Segfault when authorizer denies some steps of creating a WITHOUT ROWID table

2018-07-08 Thread sqlite
#if 0 gcc -s -O2 -o ./sqltest1 sqltest1.c sqlite3.o -ldl -lpthread exit #endif /* Test with the command: ./sqltest1 2 'create table vt(a integer primary key,b,c) without rowid;' It segfaults. If the first argument is 3 or 4 it also segfaults. */ #include #include #include #include "sql

Re: [sqlite] To JSON or not to JSON

2018-07-08 Thread Clemens Ladisch
Cecil Westerhof wrote: > my SQLite database contains for example: > > "5BF19111-9FD5-48CA-B919-A09411346A87""[ > ""The journey of a thousand miles > must begin with a single step. > > - Lao Tzu"", > ""Welke stap kun je vandaag zetten, > om dat verre doel te bereiken?"" > ]""2018-07-07"

Re: [sqlite] 3.24 database table is locked

2018-07-08 Thread Wojtek Mamrak
I found a missing sqlite_reset call in my wrapper library, and the solution proposed by Richard works great. So does the solution of guarding all the sql execute calls with a mutex. I have to perform the speed tests for the expected dataset and thread count yet. Thank you for your help! czw., 5 lip

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
2018-07-08 11:00 GMT+02:00 Cecil Westerhof : > 2018-07-08 8:19 GMT+02:00 Cecil Westerhof : > >> I thought there was a problem with RANDOM. I used: >> ,ABS(RANDOM()) / CAST(1.4E18 AS INTEGER) AS Randomiser >> >> And it seemed I got a lot of threes. >> >> To check this I used: >> SEL

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
2018-07-08 8:19 GMT+02:00 Cecil Westerhof : > I thought there was a problem with RANDOM. I used: > ,ABS(RANDOM()) / CAST(1.4E18 AS INTEGER) AS Randomiser > > And it seemed I got a lot of threes. > > To check this I used: > SELECT Randomiser > , COUNT(*) AS Count > FR

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Simon Slavin
On 8 Jul 2018, at 9:40am, Simon Slavin wrote: > Use the conventional > >CAST(RANDOM() * 7) AS INTEGER > > or whatever spread you want. Apologies. In SQLite this should be (RANDOM() % 7) instead. The percent sign is a 'modulo' operator. Simon.

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Simon Slavin
On 8 Jul 2018, at 7:19am, Cecil Westerhof wrote: > ABS(RANDOM()) / CAST(1.4E18 AS INTEGER) Don't divide by a number like 1.4e18 in an 18-digit INTEGER calculation and expect to get sensible answers. Use the conventional CAST(RANDOM() * 7) AS INTEGER or whatever spread you want. Simon. _

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
2018-07-08 10:20 GMT+02:00 Keith Medcalf : > > You probably do not have the kurtosis or skew aggregate functions either. > > generate_series is the series.c extension. > ​OK, thanks. Something to look into at a later moment. > >-Original Message- > >From: sqlite-users [mailto:sqlite-us

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Keith Medcalf
You probably do not have the kurtosis or skew aggregate functions either. generate_series is the series.c extension. --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
2018-07-08 9:10 GMT+02:00 Keith Medcalf : > > sqlite> > ​​ > select kurt(abs(random() % 7)) from generate_series where start=1 and > stop=1e6; > -1.25154453962449 > > sqlite> select skew(abs(random() % 7)) from generate_series where start=1 > and stop=1e6; > 0.00104535938599554 > > The PRNG is pre

[sqlite] To JSON or not to JSON

2018-07-08 Thread Cecil Westerhof
A long time ago I changed a line base application to a SQLite application. Every line was a record and this record could have several elements. Every element was send to Twitter with a minute between them. When converting I kept it like this. So my SQLite database contains for example: "5BF19111-9F

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Keith Medcalf
sqlite> select kurt(abs(random() % 7)) from generate_series where start=1 and stop=1e6; -1.25154453962449 sqlite> select skew(abs(random() % 7)) from generate_series where start=1 and stop=1e6; 0.00104535938599554 The PRNG is pretty random. It is slightly concave (that is, anti-normal) (a "