Re: [sqlite] values ?

2017-12-12 Thread David Raymond
Normally I think you'd just loop through each on their own, since they don't have any dependencies on each other. select 1 from foo where id = ?;--process if no records returned But you could also do with inputValues (inputValue) as (values (?), (?), (?)) select inputValue from inputValues

Re: [sqlite] values ?

2017-12-12 Thread John McKown
On Tue, Dec 12, 2017 at 12:34 PM, Mark Wagner wrote: > My reading of https://sqlite.org/syntax/select-core.html makes me think > that I should be able to issue something like values('foo'); and get a row > with a single column whose value is 'foo'. But I get a syntax error. > >

[sqlite] values ?

2017-12-12 Thread Mark Wagner
My reading of https://sqlite.org/syntax/select-core.html makes me think that I should be able to issue something like values('foo'); and get a row with a single column whose value is 'foo'. But I get a syntax error. Probably obvious to the right people but what am I missing? sqlite>

Re: [sqlite] values ?

2017-12-12 Thread Bart Smissaert
Works OK here. What is your SQLite version? RBS On Tue, Dec 12, 2017 at 6:34 PM, Mark Wagner wrote: > My reading of https://sqlite.org/syntax/select-core.html makes me think > that I should be able to issue something like values('foo'); and get a row > with a single column

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Simon Slavin
On 12 Dec 2017, at 6:27pm, Jens Alfke wrote: > On Dec 12, 2017, at 5:46 AM, Simon Slavin wrote: >> Before you answer that question, you should know that both Windows and macOS >> have been proved to have serious bugs in their memory mapping code. >

Re: [sqlite] extracting domain names from website addresses efficiently

2017-12-12 Thread Teg
Hello Peter, Monday, December 11, 2017, 9:16:27 AM, you wrote: PDS> This seems like a job for regular expressions. PDS> PDS> ___ PDS> sqlite-users mailing list PDS> sqlite-users@mailinglists.sqlite.org PDS>

Re: [sqlite] Seasonal syntax

2017-12-12 Thread Stephen Chrzanowski
You had to do that just beclause On Tue, Dec 12, 2017 at 12:24 PM, Simon Slavin wrote: > Some SQL terminology: > > Selection Clause: WHERE >Sort Clause: ORDER BY > Sublist Clause: LIMIT OFFSET > Subsort Clause: GROUP BY HAVING > Santa

Re: [sqlite] values ?

2017-12-12 Thread Stephen Chrzanowski
Nifty... but... With no option for "where" or "order by", where would this come in useful? On Tue, Dec 12, 2017 at 1:48 PM, Mark Wagner wrote: > Argh. Yes, I was on 3.8.2. Thanks! > > On Tue, Dec 12, 2017 at 10:45 AM, Richard Hipp wrote: > > > On 12/12/17,

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Jens Alfke
> On Dec 12, 2017, at 5:46 AM, Simon Slavin wrote: > > The stray pointer or array overrun is not in the SQLite code. It’s in the > implementation of memory mapping built into the OS. So you need to ask > yourself whether you trust your OS. This argument (which is a

Re: [sqlite] values ?

2017-12-12 Thread Richard Hipp
On 12/12/17, Mark Wagner wrote: > My reading of https://sqlite.org/syntax/select-core.html makes me think > that I should be able to issue something like values('foo'); and get a row > with a single column whose value is 'foo'. But I get a syntax error. > > Probably obvious to

[sqlite] Seasonal syntax

2017-12-12 Thread Simon Slavin
Some SQL terminology: Selection Clause: WHERE Sort Clause: ORDER BY Sublist Clause: LIMIT OFFSET Subsort Clause: GROUP BY HAVING Santa Clause: SELECT name,hobbies,address FROM people WHERE behaviour='nice’ Season’s greetings and best wishes to all subscribers.

Re: [sqlite] values ?

2017-12-12 Thread Mark Wagner
Argh. Yes, I was on 3.8.2. Thanks! On Tue, Dec 12, 2017 at 10:45 AM, Richard Hipp wrote: > On 12/12/17, Mark Wagner wrote: > > My reading of https://sqlite.org/syntax/select-core.html makes me think > > that I should be able to issue something like

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Martin Raiber
On 12.12.2017 19:47 Simon Slavin wrote: > On 12 Dec 2017, at 6:27pm, Jens Alfke wrote: > >> On Dec 12, 2017, at 5:46 AM, Simon Slavin wrote: >>> Before you answer that question, you should know that both Windows and >>> macOS have been proved to have

[sqlite] Can a trigger recursively update a table?

2017-12-12 Thread Shane Dev
Hi, I have a hierarchical table - sqlite> .sch hierarchy CREATE TABLE hierarchy(id integer primary key, parent references hierarchy, descrip text, status text); with some entries - sqlite> select * from hierarchy; id parent descrip status 1 rootopen 2 1

Re: [sqlite] Can a trigger recursively update a table?

2017-12-12 Thread J. King
CTEs cannot be used inside triggers for UPDATE statements. See near the bottom of: On December 12, 2017 6:44:35 PM EST, Shane Dev wrote: >Hi, > >I have a hierarchical table - > >sqlite> .sch hierarchy >CREATE TABLE hierarchy(id

Re: [sqlite] Can a trigger recursively update a table?

2017-12-12 Thread Igor Tandetnik
On 12/12/2017 6:44 PM, Shane Dev wrote: However, if I try to create a trigger with this statement - http://www.sqlite.org/lang_with.html """ Limitations And Caveats - The WITH clause cannot be used within a CREATE TRIGGER. """ -- Igor Tandetnik ___

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Howard Chu
Jens Alfke wrote: I’m skeptical about mmap being broken on Macs, since there are other production databases such as Realm* that use it heavily. (Though I am not sure whether Realm uses writeable mappings.) —Jens * and LMDB, but I am not sure if LMDB is in use on macOS. LMDB is in common

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Howard Chu
Martin Raiber wrote: On 12.12.2017 19:47 Simon Slavin wrote: On 12 Dec 2017, at 6:27pm, Jens Alfke wrote: On Dec 12, 2017, at 5:46 AM, Simon Slavin wrote: Before you answer that question, you should know that both Windows and macOS have been

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread J Decker
On Tue, Dec 12, 2017 at 4:35 PM, Howard Chu wrote: > Martin Raiber wrote: > >> On 12.12.2017 19:47 Simon Slavin wrote: >> >>> On 12 Dec 2017, at 6:27pm, Jens Alfke wrote: >>> >>> On Dec 12, 2017, at 5:46 AM, Simon Slavin wrote:

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Howard Chu
J Decker wrote: On Tue, Dec 12, 2017 at 4:35 PM, Howard Chu wrote: Martin Raiber wrote: On 12.12.2017 19:47 Simon Slavin wrote: On 12 Dec 2017, at 6:27pm, Jens Alfke wrote: On Dec 12, 2017, at 5:46 AM, Simon Slavin wrote:

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Jens Alfke
> On Dec 12, 2017, at 10:47 AM, Simon Slavin wrote: > > See this thread: > > >

Re: [sqlite] values ?

2017-12-12 Thread Mark Wagner
My use case was this. For some given input, find which of those input values do not have corresponding rows in a given table. In other words something like this (but values seemed easier). select '1' as x union select '2' as x union select '3 as x where x not in (select id from foo); Picture

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
Thanks for the notification about the bugs in MacOS. So the most important reason for disable SQLITE_MMAP_READWRITE is the bugs in OS, not the stray pointer in upper applications. Is it right? -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
Yeah. Thanks for your suggestion about -DSQLITE_ENABLE_BATCH_ATOMIC_WRITE. But the version of my sqlite is 3.16.2, so I guess I may use it at a later time int the future. -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___ sqlite-users mailing list

Re: [sqlite] Can a trigger recursively update a table?

2017-12-12 Thread Shane Dev
Thanks for your answers, I missed that part of the create trigger documentation. Can we conclude there is no single CTE or other SQL statement which can update a branch of the tree starting with a flexibly specified node? i.e. I have to "hard-code" the starting node (top of branch) in my CTE

Re: [sqlite] [EXTERNAL] values ?

2017-12-12 Thread Hick Gunter
You have to SELECT that -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Mark Wagner Gesendet: Dienstag, 12. Dezember 2017 19:35 An: SQLite mailing list Betreff: [EXTERNAL] [sqlite]

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
OK, I know it is not safe when use mmap in Android 7 fuse. And do you mean the bug is in fuse kernel framework as you mentioned Android FUSE filesystem driver? Which corresponding to Linux 3.10? By the way, do you have any possible repro steps especially in Android Sqlite? -- Sent from:

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Richard Hipp
On 12/12/17, advancenOO wrote: > Um, stray pointer or array overrun in upper applications will be treated as > BUG in my system. And I believe all these bugs could be fixed before using > sqlite. You have a very optimistic view of application software :-) Look - if

Re: [sqlite] extracting domain names from website addresses efficiently

2017-12-12 Thread Klaus Maas
Very interesting. I must be very slow, because at first I did no get what this was about, although you fed it me on a spoon. This is actually very straightforward. I find this easier to understand than recursive CTEs. Thank you, Peter and IgorT, for helping me on my way to understand this

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
Um, stray pointer or array overrun in upper applications will be treated as BUG in my system. And I believe all these bugs could be fixed before using sqlite. So can I safely enable SQLITE_MMAP_READWRITE directly if I can ignore the possibility of the BUG? But I notice that Sqlite may not call

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread advancenOO
I am a developer of system, not application. So I have nothing to do with the SQL or indices even though I know these may cut orders of magnitude from execution times. And that is why I use speedtest1.c of Sqlite to evaluate the performance of my system. -- Sent from:

Re: [sqlite] Enabling MMAP in Android

2017-12-12 Thread Simon Slavin
On 12 Dec 2017, at 1:32pm, advancenOO wrote: > Um, stray pointer or array overrun in upper applications will be treated as > BUG in my system. And I believe all these bugs could be fixed before using > sqlite. > So can I safely enable SQLITE_MMAP_READWRITE directly