comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: GNATCOLL SQLite3 vs Ada.Calendar.Time
Date: Thu, 18 Aug 2016 11:28:30 -0700
Date: 2016-08-18T11:28:30-07:00	[thread overview]
Message-ID: <np4uok$old$1@dont-email.me> (raw)
In-Reply-To: <7a1eaa60-3be9-4e9b-b67a-d174f3960276@googlegroups.com>

On 08/18/2016 10:45 AM, Stephen Leake wrote:
> 
> Yes, that works. Although I'm not clear why; 
> https://www.sqlite.org/lang_datefunc.html defines that function to return a string, and the examples are about output formatting. Apparently it has a different meaning when processing bound parameters.

I know nothing about SQLite or how GNATColl accesses it, but ...

Clearly, the query produced using a bare '?' and "+" applied to an
Ada.Calendar.Time is different from the query produced using a bare '?' and "+"
applied to a string [with contents in the correct format]. The query produced
using "datetime(?)" and "+" applied to an Ada.Calendar.Time is equivalent to the
query produced using a bare '?' and "+" applied to a string. Presumably, the
result of "+" applied to an Ada.Calendar.Time is different from "+" applied to a
string, but passing the former to datetime corrects it.

I would guess that, since you used strings to insert the datetime values, SQLite
is using TEXT representation for them. Also that "+" applied to an
Ada.Calendar.Time is producing a non-string result (numeric?) and SQLite has
problems dealing with the combination. Or something.

Personally, I'd want to compare the results of the two "+" calls (which might
require some cheating). I'd also want to see the resulting SQL statements from
substituting them for the '?'. One could then feed those SQL statements directly
into SQLite to see if the problem is in GNATColl or SQLite.

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers
49

  parent reply	other threads:[~2016-08-18 18:28 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
2016-08-19 17:43         ` G.B.
2016-08-18 18:28     ` Jeffrey R. Carter [this message]
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