On 07/28/2016 12:28 PM, Fernando Sáenz Pérez wrote:
> Hi,
> I used DES <
http://des.sourceforge.net> to test this quickly. Now I have
> prepared a test file for highlighting the issue, which is attached here,
> where the call test(+Connection,-Result) reveals it. The very same
> problem occurs in DB2, PostgreSQL and MySQL.
Thanks ...
Hmmm. Just tried on Ubuntu 16.04 (Xenial) using PostgreSQL. Runs fine.
Unfortunately Ubuntu 16.04 ships with MySQL 5.7 for which the ODBC
driver is missing :( Also tried the Windows version of Prolog, still
talking to the same Linux PostgreSQL server. Works fine too.
Is there someone around with a setup that reproduces this and allows for
recompiling the ODBC interface? I've now spent several hours setting up
(partially in vain) different databases and configuring ODBC drivers ...
Cheers --- Jan
> All the best,
> Fernando
>
> 2016-07-28 12:10 GMT+02:00 Jan Wielemaker <
J.Wiel...@vu.nl
> <mailto:
J.Wiel...@vu.nl>>:
>
> On 28/07/16 11:39, Fernando Sáenz Pérez wrote:
> > Hi,
> > I get the same behaviour in Windows 10 64bit, DB2 10.5, ODBC
> > 10.05.500.107 (IBM DB2 ODBC DRIVER), and SWI-Prolog 7.2.3 64bit.
> > This seems to be an issue in the SWI-Prolog ODBC interface because
> > SICStus handles well the DB2 date data type with the same OS ODBC driver.
> > All the best,
> > Fernando
>
> As you got the test case, can you include the complete code to build
> and query the DB? That saves time and avoids confusion.
>
> Thanks --- Jan
>
>
> > 2016-07-28 11:28 GMT+02:00 Pieter Stroobants
> > <
pieter.s...@gmail.com <mailto:
pieter.s...@gmail.com>
> <mailto:
pieter.s...@gmail.com
> <mailto:
pieter.s...@gmail.com>>>:
> >
> > When working with SWI Prolog's ODBC connection, I encountered an
> > error which seems to be caused by Prolog itself. Consider
> >
> > |
> > odbc_connect('M',_,[user(bla),password(bla),alias(m),open(once)]),
> > findall(ca(Id),odbc_query(m,'select DA_BEGIN from ABC',row(Id)),Lemmas),
> > odbc_disconnect(maatregelen).
> > |
> >
> > This example causes an ODBC error S1003 on DB2 version 10.5.3 if
> > DA_BEGIN is of SQL datatype date. Even if you add an explicit
> > convertion argument to odbc_query like [types([date])] you
> > receive the same error.
> >
> > However if you convert the date to a timestamp like:
> >
> > |
> > odbc_connect('M',_,[user(bla),password(bla),alias(m),open(once)]),
> > findall(ca(Id),odbc_query(m,'select DA_BEGIN from
> > ABC',row(Id),[types([timestamp])]),Lemmas),
> >
> > odbc_disconnect(maatregelen).
> > |
> >
> > This code seems to work perfectly. My question now is: is this error
> > related to the prolog interface or is it related to the ODBC driver.
> > To me it seems that there is an error in the prolog convertion layer
> > between SQL date and prolog date.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "SWI-Prolog" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to
swi-prolog+...@googlegroups.com
> <mailto:
swi-prolog%2Bunsu...@googlegroups.com>
> > <mailto:
swi-prolog+...@googlegroups.com
> <mailto:
swi-prolog%2Bunsu...@googlegroups.com>>.
> <mailto:
swi-prolog%2Bunsu...@googlegroups.com>
> > <mailto:
swi-prolog+...@googlegroups.com
> <mailto:
swi-prolog%2Bunsu...@googlegroups.com>>.