[sqlite] Trigger Question

2017-10-11 Thread Stephen Chrzanowski
I'm setting up a resource string to drop, recreate, and repopulate a table to use as a type of default values for colors on the UI. Essentially a default set of priority levels and FG/BG colors associated with that priority color. The table schema is as such: CREATE TABLE [ColorScheme]( [Pri

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread Keith Medcalf
>Better yet, either one of the datetime() or julianday() functions >(with the same one used consistently in all places) will work best >for comparison since the output for either one sorts correctly >against itself. strftime() should be saved for display formatting. Only for a timestring with a c

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread Don V Nielsen
> Of course now I think about it, strftime always being a string means that > you either should avoid the '%s' conversion or cast it to a number on both > sides, so you don't get the '100' < '20' situation. >> sqlite> select strftime('%s', '1970-01-01 00:01:40') < strftime('%s', '1970-01-01 00:00:

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread David Raymond
All correct, yes. Of course now I think about it, strftime always being a string means that you either should avoid the '%s' conversion or cast it to a number on both sides, so you don't get the '100' < '20' situation. Better yet, either one of the datetime() or julianday() functions (with the

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread Tim Streater
On 11 Oct 2017, at 18:53, R Smith wrote: > Yes. When you concatenate/add a string and integer together some SQL > engines will try to give a sensible result, so that '5' + 3 will yield 8 > because 3 is INT and it reckons that '5' probably meant 5 since it is > added to another INT and the 5 do

Re: [sqlite] SQLite version 3.21.0 in approximately two weeks

2017-10-11 Thread Ward WIllats
> On Oct 11, 2017, at 4:26 AM, Richard Hipp wrote: > > A summary of changes for the 3.21.0 release can be seen at > >https://sqlite.org/draft/releaselog/3_21_0.html Item #5: "A forger can subverted" ==> "A forger can subvert" ___ sqlite-users

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread R Smith
On 2017/10/11 7:15 PM, Don V Nielsen wrote: So strftime always returns TEXT. Correct? Yes. The "str" in "strftime" means "string" which is text output. You can read the name "strftime" as "string-formatted-time value". It was the application of +300 to that result that changed the type to

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread Don V Nielsen
So strftime always returns TEXT. Correct? It was the application of +300 to that result that changed the type to INTEGER. And had "+300 seconds" been applied as a modifier in the strftime function, then the addition would have occurred before producing the result, with the result being type TEXT. C

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread David Raymond
Sorter version of a longer bit I was writing that got complicated: Expressions don't have "Affinity" so when both sides of a comparison operator are expressions they need to be the same type for it to mean anything. One of the ways to do that in this example is to move the +300 inside the strfti

Re: [sqlite] sqlite3_expert Status

2017-10-11 Thread Simon Slavin
On 11 Oct 2017, at 10:53am, Dominique Devienne wrote: > For those like me who missed / forgot / didn't know about SQLite Expert, > read about it here: https://www.sqlite.org/cgi/src/tree?name=ext/expert --DD That’s clever. I like that. Simon. ___ s

Re: [sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread David Raymond
See https://sqlite.org/draft/datatype3.html in section 4.1, Sort Order. Any integer is less than any text. So you'll want to have both as one of the number types to do valid comparison. 4.1 Sort Order The results of a comparison depend on the storage classes of the operands, according to the fo

[sqlite] Possible bug with strftime('%s') < strftime('%s')

2017-10-11 Thread Eric Bollengier
Hello, I have noticed a problem in SQLite 3.20.1 for a simple operation based on strftime('%s'). With SQLite 3.20.1 and 3.6.18 sqlite> select (strftime('%s', '2017-10-11 10:04:43') + 300) <  strftime('%s', '2017-10-11 10:04:43'); 1 If I use the CAST operator on the second member, it works sql

Re: [sqlite] Script Embedded SQLite With TCL

2017-10-11 Thread Peter Da Silva
There doesn’t seem to be a straightforward way to get the SQLite handle from the Tcl SQL command, but it is possible. https://github.com/flightaware/Pgtcl/blob/master/generic/pgtclSqlite.c#L838 On 10/7/17, 9:31 AM, "sqlite-users on behalf of apajabo yaro" wrote: Hello,I am writing a C++

[sqlite] SQLite version 3.21.0 in approximately two weeks

2017-10-11 Thread Richard Hipp
The planned release date for SQLite version 3.21.0 is 2017-10-25. The latest release candidate is available as the "Prerelease Snapshot" at https://sqlite.org/download.html or can be accessed directly from the version control system at https://sqlite.org/src/timeline?c=branch-3.21 A summary

Re: [sqlite] sqlite3_expert Status

2017-10-11 Thread Dominique Devienne
On Wed, Oct 11, 2017 at 10:58 AM, Philip Bennefall wrote: > I was curious to know the status of the sqlite3_expert extension? I > followed its development with great interest earlier in the year and was > wondering if there are any plans to merge it to trunk? What kind of work > remains (if any)

[sqlite] sqlite3_expert Status

2017-10-11 Thread Philip Bennefall
Dear SqLite developers, I was curious to know the status of the sqlite3_expert extension? I followed its development with great interest earlier in the year and was wondering if there are any plans to merge it to trunk? What kind of work remains (if any) before it can be considered complete?