comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: GNATCOLL SQLite3 vs Ada.Calendar.Time
Date: Fri, 19 Aug 2016 08:30:30 -0700 (PDT)
Date: 2016-08-19T08:30:30-07:00	[thread overview]
Message-ID: <3c38b5cc-736b-40ed-bfdd-7df36d0b5c59@googlegroups.com> (raw)
In-Reply-To: <55122d87-53ee-4996-acb2-7d0e2d962eca@googlegroups.com>

On Thursday, August 18, 2016 at 1:13:40 PM UTC-5, Stephen Leake wrote:
> On Thursday, August 18, 2016 at 12:45:11 PM UTC-5, Stephen Leake wrote:
> > On Thursday, August 18, 2016 at 6:19:45 AM UTC-5, G.B. wrote:
> > > On 17.08.16 23:05, Stephen Leake wrote:
> > > > One solution would be to replace the "DATETIME" field type in the .sql file with "TEXT", always pass strings for times, and rely on lexicographic sorting for time comparison. But that seems extreme.
> > > 
> > > It seems advisable to use SQLite's Date And Time Functions
> > > when using SQLite for SQL. Thus,
> > > 
> > >     " ... WHERE Modified >= datetime(?) ... "
> > > 
> > 
> > Yes, that works. 
> 
> I take it back; it fixed most of the problems in the full program, but not all.
> 
> So I'm switching to CHAR[19] for date/time fields.

Which _also_ did not fix the problem. Which makes sense, given that SQL apparently uses TEXT for DATETIME.

So I wrote code to substitute the time string for the ?, and pass a single string to SQLite3 with no bound parameters; that fixed the problem.

There is apparently a problem with bound string parameters and >= in queries. Bound parameters with = INTEGER or LIKE %STRING work (so far, anyway).

-- Stephe


  reply	other threads:[~2016-08-19 15:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 21:05 GNATCOLL SQLite3 vs Ada.Calendar.Time Stephen Leake
2016-08-18  8:09 ` Dmitry A. Kazakov
2016-08-18 11:19 ` G.B.
2016-08-18 17:45   ` Stephen Leake
2016-08-18 18:13     ` Stephen Leake
2016-08-19 15:30       ` Stephen Leake [this message]
2016-08-19 17:43         ` G.B.
2016-08-18 18:28     ` Jeffrey R. Carter
2016-08-18 19:48       ` Dmitry A. Kazakov
2016-08-18 20:50         ` Jeffrey R. Carter
2016-08-18 22:05         ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox