From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.31.163.84 with SMTP id m81mr5025501vke.7.1471620630834; Fri, 19 Aug 2016 08:30:30 -0700 (PDT) X-Received: by 10.157.37.209 with SMTP id q75mr596225ota.15.1471620630779; Fri, 19 Aug 2016 08:30:30 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!c52no9687515qte.1!news-out.google.com!d130ni40251ith.0!nntp.google.com!f6no11258508ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 19 Aug 2016 08:30:30 -0700 (PDT) In-Reply-To: <55122d87-53ee-4996-acb2-7d0e2d962eca@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.218.37.33; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.218.37.33 References: <7a1eaa60-3be9-4e9b-b67a-d174f3960276@googlegroups.com> <55122d87-53ee-4996-acb2-7d0e2d962eca@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3c38b5cc-736b-40ed-bfdd-7df36d0b5c59@googlegroups.com> Subject: Re: GNATCOLL SQLite3 vs Ada.Calendar.Time From: Stephen Leake Injection-Date: Fri, 19 Aug 2016 15:30:30 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:31464 Date: 2016-08-19T08:30:30-07:00 List-Id: 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