[sqlite] How to build a Windows DLL with cygwin

2019-06-10 Thread Jose Isaias Cabrera
Greetings! I have been a Cygwin user since its infancy, and I have been looking for a way to build SQLite Windows DLL with Cygwin, and I just found how to do this. I know I can use MinGW, which is the way I was doing it, but if you have Cygwin, you can just follow this steps: 1. use your

Re: [sqlite] Unexpected/undocumented REPLACE() behavior

2019-06-10 Thread Shawn Wagner
With most functions, including replace(), if any of the arguments are null, it returns null. On Mon, Jun 10, 2019 at 4:29 PM Tony Papadimitriou wrote: > Example: > > --- CUT --- > create table t(s text); > insert into t values ('1'),('null'),('3'); > > .print 'BEFORE' > select rowid,* from t; >

[sqlite] Unexpected/undocumented REPLACE() behavior

2019-06-10 Thread Tony Papadimitriou
Example: --- CUT --- create table t(s text); insert into t values ('1'),('null'),('3'); .print 'BEFORE' select rowid,* from t; update t set s = replace(s,'null',null) --where s = 'null' --adding this works of course but that’s not my point ; .print 'AFTER' select rowid,* from t; --- CUT ---

Re: [sqlite] Unexpected parsing of an invalid CREATE TABLE statement

2019-06-10 Thread Shawn Wagner
Forgiving, yes, but usually not /that/ forgiving. It's certainly caused some wasted time going down the wrong path trying to debug an issue. On Mon, Jun 10, 2019 at 3:39 PM Richard Hipp wrote: > On 6/10/19, Shawn Wagner wrote: > > Consider: > > > > CREATE TABLE a(id INTEGER PRIMARY KEY); > >

Re: [sqlite] Unexpected parsing of an invalid CREATE TABLE statement

2019-06-10 Thread Richard Hipp
On 6/10/19, Shawn Wagner wrote: > Consider: > > CREATE TABLE a(id INTEGER PRIMARY KEY); > CREATE TABLE b(id INTEGER PRIMARY KEY); > CREATE TABLE c(id INTEGER PRIMARY KEY, a_id, b_id, >FOREIGN KEY (a_id) REFERENCES a(id) >FOREIGN KEY (b_id) REFERENCES b(id)); > >

[sqlite] Unexpected parsing of an invalid CREATE TABLE statement

2019-06-10 Thread Shawn Wagner
Consider: CREATE TABLE a(id INTEGER PRIMARY KEY); CREATE TABLE b(id INTEGER PRIMARY KEY); CREATE TABLE c(id INTEGER PRIMARY KEY, a_id, b_id, FOREIGN KEY (a_id) REFERENCES a(id) FOREIGN KEY (b_id) REFERENCES b(id)); Note the lack of comma between the two foreign key

Re: [sqlite] Optimising multiple group by clauses

2019-06-10 Thread E.Pasma
Hello, > explain query plan select > prod, > per, > min(val) > from > (select >prod, >per, >mar, >sum(val) as val > from >data > group by >prod, >per, >mar) > group by > prod, > per > ; > QUERY PLAN > |--CO-ROUTINE 1 > | `--SCAN TABLE data USING INDEX

Re: [sqlite] How to insert the BLOB in database?

2019-06-10 Thread Luuk
On 10-6-2019 05:08, Mark Halegua wrote: On Monday, June 10, 2019 03:46:02 AM Simon Slavin wrote: On 10 Jun 2019, at 3:44am, Mark Halegua wrote: I probably should figure this out, but in a GUI, how do I recover a graphic from the database? Programming. SQLite can't do it since it doesn't