I guess not the ODBC one, no?
Only fixed the rational numbers issue. For the ODBC connection, the error raises with the following version of SQL Server (default configuration):
Microsoft SQL Server 2014 - 12.0.2269.0 (X64) Jun 10 2015 03:35:45 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows NT 6.3 <X64> (Build 19043: )
For a database “test” with a table “dual” including a single column “void” with type “int”:
By debugging the connection to this database and extracting its metadata, it seems that the issue comes from the call to odbc_column
/3 (library/odbc.pl
in the SWI-Prolog installation) in:
table_column(Connection, Table, Column, Tuple) :-
( var(Table)
-> odbc_current_table(Connection, Table)
; true
),
( ground(Column) % force determinism
-> odbc_column(Connection, Table, Tuple),
arg(4, Tuple, Column), !
; odbc_column(Connection, Table, Tuple),
arg(4, Tuple, Column)
).
SWI-Prolog Version 7.4.2:
Call: (58) 'odbc':odbc_column('$odbc_connection'(6028676), 'dual', _55912) ? creep
Exit: (58) 'odbc':odbc_column('$odbc_connection'(6028676), 'dual', row('test', 'dbo', 'dual', 'void', 4, 'int', 10, 4, 0, 10, 1, '$null$', '$null$', 4, '$null$', '$null$', 1, 'YES', 0, 0, 0, 0, '$null$', '$null$', '$null$', '$null$', '$null$', '$null$', 38)) ?
SWI-Prolog Version 8.2.4-1:
* Call: (62) 'odbc':odbc_column('$odbc_connection'(145719600), 'dual', _110658) ? skip
* Exception: (61) 'odbc':table_column('$odbc_connection'(145719600), 'dual', _110264, _110734) ?
And the ODBC configuration is as follows:
Other ODBC connections seem to work well in version 8.2.4-1 (Access, PostgreSQL, MySQL, Oracle, DB2).