Re: [sqlite] Kind of pivot table

2018-07-09 Thread Richard Damon
On 7/9/18 12:48 PM, Jens Alfke wrote: >> On Jul 7, 2018, at 11:49 PM, Keith Medcalf wrote: >> >> Why not use MOD (%) as in >> >> ABS(RANDOM() % 6) > Because modulo bias. If the RHS doesn't evenly divide the size of the range > of RANDOM(), some results will be slightly more likely than others. >

Re: [sqlite] I'm getting a compiler error on a SQLIte build on Ubuntu 16.04 (which surprises me)

2018-07-09 Thread David Burgess
I'm using gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 on 64 bit. I have built both 64 and 32 bit versions from sqlite-src-324 No problems. Check your build-essential install? On Tue, Jul 10, 2018 at 1:05 AM, Dan Kennedy wrote: > On 07/09/2018 09:26 PM, Rob Willett wrote: >> >>

Re: [sqlite] Round-tripping SQLite back and forth between text representation.

2018-07-09 Thread Simon Slavin
On 10 Jul 2018, at 1:52am, Randall Smith wrote: > I'm curious if there is some standard or normal way to convert a SQLite DB to > a text representation, and then recreate the DB content from the text. > Naively, this seems hard or impossible as a general problem, but perhaps I am > missing

Re: [sqlite] Round-tripping SQLite back and forth between text representation.

2018-07-09 Thread Keith Medcalf
.dump in the command line shell? --- 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:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Randall Smith >Sent:

Re: [sqlite] Round-tripping SQLite back and forth between text representation.

2018-07-09 Thread J Decker
does it have to be text? There was serialization added to sqlite https://www.sqlite.org/c3ref/serialize.html On Mon, Jul 9, 2018 at 5:52 PM Randall Smith wrote: > I'm curious if there is some standard or normal way to convert a SQLite DB > to a text representation, and then recreate the DB

[sqlite] Round-tripping SQLite back and forth between text representation.

2018-07-09 Thread Randall Smith
I'm curious if there is some standard or normal way to convert a SQLite DB to a text representation, and then recreate the DB content from the text. Naively, this seems hard or impossible as a general problem, but perhaps I am missing something. Thanks in advance for any advice or

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Richard Hipp
On 7/9/18, R Smith wrote: > a - Does it affect the UPSERT statement's ON CONFLICT clause? i.e. does > INSERT ON CONFLICT... trigger the conflict resolution when the > CHECK fails? No UPSERT only works for uniqueness constraints (UNIQUE or PRIMARY KEY). > b - If so, would it be real hard

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread R Smith
On 2018/07/10 12:53 AM, Richard Hipp wrote: CREATE TABLE t1(x INT, CHECK(x!=5) ON CONFLICT IGNORE); However, the parser silently discards the ON CONFLICT clause. I think this has always been the case. Well, I feel embarrassed, I have used this CHECK conflict clause a good number of times

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Richard Hipp
On 7/9/18, Thomas Kurz wrote: > Hello, > > is there a way to have Sqlite ignore check violations? > > I would like to do: > > CREATE TABLE (name TEXT NOT NULL CHECK (name<>'') ON CONFLICT IGNORE > > but the "on conflict" is not accepted here. It does not appear that SQLite has ever acted

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Simon Slavin
On 9 Jul 2018, at 10:21pm, Thomas Kurz wrote: > However, this is a bit confusing as e.g. this works fine: > > CREATE TABLE test (col1 TEXT UNIQUE ON CONFLICT IGNORE); There is actually a way to do what you want. You do it with a TRIGGER which does the test and drops the offending row using

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Simon Slavin
On 9 Jul 2018, at 10:21pm, Thomas Kurz wrote: > However, this is a bit confusing as e.g. this works fine: > > CREATE TABLE test (col1 TEXT UNIQUE ON CONFLICT IGNORE); By 'works fine' do you mean you didn't get a syntax error, or do you mean that the clause actually does what you want, both to

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Thomas Kurz
> Yes. The ON CONFLICT clause goes in the INSERT command. Ok, thank you very much. However, this is a bit confusing as e.g. this works fine: CREATE TABLE test (col1 TEXT UNIQUE ON CONFLICT IGNORE); May I suggest the appropriate extension for CHECK ON CONFLICT IGNORE or is there a thoughtful

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Simon Slavin
On 9 Jul 2018, at 10:00pm, Thomas Kurz wrote: > I get a "syntax error near on": > CREATE TABLE test (col1 TEXT CHECK (col1<>'') ON CONFLICT IGNORE); > > Am I using a wrong syntax? Yes. The ON CONFLICT clause goes in the INSERT command. CREATE TABLE test (col1 TEXT CHECK (col1<>''));

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Thomas Kurz
Thank you, but I think there is a misunderstanding. I do want the constraint to be checked, but I want to ignore the attempt to insert values that would violate the check constraint. According to the "on conflict" documentation (https://sqlite.org/lang_conflict.html), "The ON CONFLICT clause

Re: [sqlite] CHECK IGNORE?

2018-07-09 Thread Richard Hipp
On 7/9/18, Thomas Kurz wrote: > is there a way to have Sqlite ignore check violations? > https://www.sqlite.org/pragma.html#pragma_ignore_check_constraints -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

[sqlite] CHECK IGNORE?

2018-07-09 Thread Thomas Kurz
Hello, is there a way to have Sqlite ignore check violations? I would like to do: CREATE TABLE (name TEXT NOT NULL CHECK (name<>'') ON CONFLICT IGNORE but the "on conflict" is not accepted here. ___ sqlite-users mailing list

[sqlite] Feature request: degenerates in Lemon's report

2018-07-09 Thread Cezary H. Noweta
Hello, Could you allow an outputting of autoreduced states when they produce conflicts? I have noticed that such errors are caused by small and hard-to-find remnants in a grammar file. There is no other way to detect such errors. A few lines are getting the problem off (function

Re: [sqlite] Kind of pivot table

2018-07-09 Thread Jens Alfke
> On Jul 7, 2018, at 11:49 PM, Keith Medcalf wrote: > > Why not use MOD (%) as in > > ABS(RANDOM() % 6) Because modulo bias. If the RHS doesn't evenly divide the size of the range of RANDOM(), some results will be slightly more likely than others.

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

2018-07-09 Thread Simon Slavin
On 9 Jul 2018, at 4:13pm, Simon Slavin wrote: > You can find (especially if you're willing to pay) standards for SQL since > the 1992 one: 1999, 2003, 2006, 2008 etc.. However, they quickly became so > large and complicated that no implementation of SQL implemented as much of > the later

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

2018-07-09 Thread Simon Slavin
On 9 Jul 2018, at 1:57pm, Aaron Elkins wrote: > Thank you for the interesting explanations for SQL specific cases, and I am > also interested in the SQL standard document after reading your email, can > you point me to the right place? SQL-86 was the first widely-adopted SQL standard.

Re: [sqlite] I'm getting a compiler error on a SQLIte build on Ubuntu 16.04 (which surprises me)

2018-07-09 Thread Dan Kennedy
On 07/09/2018 09:26 PM, Rob Willett wrote: Dan, Thanks for the information. We did try that first, failed and just assumed we were idiots and went to the the other download. Just downloaded it again, so we can check and be on the safe side, and we get the same issue. cp

Re: [sqlite] I'm getting a compiler error on a SQLIte build on Ubuntu 16.04 (which surprises me)

2018-07-09 Thread Rob Willett
Dan, Thanks for the information. We did try that first, failed and just assumed we were idiots and went to the the other download. Just downloaded it again, so we can check and be on the safe side, and we get the same issue. cp /jambuster/src/sqlite-src-324/ext/session/sqlite3session.h

Re: [sqlite] I'm getting a compiler error on a SQLIte build on Ubuntu 16.04 (which surprises me)

2018-07-09 Thread Dan Kennedy
On 07/09/2018 03:56 PM, rob.sql...@robertwillett.com wrote: Hi I'm trying to build the SQLite packages from the source. I **only** want it to get a copy of sqlite_analyse which for some reason doesn't appear to be easily available as a compiled option. The download package doesn't work on

Re: [sqlite] I'm getting a compiler error on a SQLIte build on Ubuntu 16.04 (which surprises me)

2018-07-09 Thread Rob Willett
Clemens, Thanks. We were up to date anyway, but we did check and we still get the same error. It does look like a compiler bug, also nobody else seems to have reported it, which I think is very odd. I cannot be the first person to compile this version of SQLite on Ubuntu 16.04 server.

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

2018-07-09 Thread Thomas Kurz
As far as I know you have to purchase the documents. - Original Message - From: Aaron Elkins To: SQLite mailing list Sent: Monday, July 9, 2018, 14:57:07 Subject: [sqlite] What happens when a call contains two SQL statement Hi Ryan, Thank you for the interesting explanations for SQL

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

2018-07-09 Thread Aaron Elkins
Hi Ryan, Thank you for the interesting explanations for SQL specific cases, and I am also interested in the SQL standard document after reading your email, can you point me to the right place? Sorry, I did not trust myself to find the official SQL standard by googling. - Aaron > On Jul

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

2018-07-09 Thread R Smith
I see Gunter already answered this for the specific case, I'll just add some simple rules of thumb for transactions in general: 1. SQLite automagically starts a transaction ONLY when faced with a single statement. The second statement in your query/list/script is in its own transaction and

[sqlite] SQLite.NET Class Library Documentation Feedback: Designer Support

2018-07-09 Thread Roger Schlueter
SQLite.NET Help     Introduction to System.Data .SQLite         Initializing Design-Time Support             Express Edition Limitations This whole section should be removed since it is no longer correct, especially the part in red.  If you want to include the versions of Visual Studio just

Re: [sqlite] I'm getting a compiler error on a SQLIte build on Ubuntu 16.04 (which surprises me)

2018-07-09 Thread Clemens Ladisch
rob.sql...@robertwillett.com wrote: > gcc: internal compiler error: Killed (program cc1) This is a compiler bug. Check if updating gcc to a current version helps. > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. Otherwise, do this.

[sqlite] I'm getting a compiler error on a SQLIte build on Ubuntu 16.04 (which surprises me)

2018-07-09 Thread rob . sqlite
Hi I'm trying to build the SQLite packages from the source. I **only** want it to get a copy of sqlite_analyse which for some reason doesn't appear to be easily available as a compiled option. The download package doesn't work on Ubuntu 16.04 and as far as we can see, there are no other

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

2018-07-09 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-09 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

Re: [sqlite] Use with Visual Studio

2018-07-09 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

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

2018-07-09 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

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

2018-07-09 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-09 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