--
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.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.
* What database is he using? (SQL Server, I'm guess).
* What version of the database (I think it's very very old, but that's just a guess)
* What driver is he using? The MS SQL Native client? FreeTDS? The Windows SQL Server driver? Something else?
* What version of that driver?
I tried it here, and it worked fine once I changed
odbc_query(Handle,
'insert into t values("2016-05-31")',
_),
to
odbc_query(Handle,
'insert into t values(\'2016-05-31\')',
_),
since the first one gave me an error that there was no such column '2016-05-31', (I think this is right - the quote character for SQL is ' and not ", so I think that means that "2016-05-31" is interpreted as a column name).
A quick google for the error message seems to turn up a lot of references to really old versions of SQL Server and some workarounds to deal with shortcomings in them. Perhaps this is a problem that has nothing to do with Prolog or odbc4pl and everything to do with Fernando's setup?
On Monday, May 30, 2016 at 7:40:59 PM UTC+2, Fernando Sáenz Pérez wrote:
On Monday, May 30, 2016 at 7:40:59 PM UTC+2, Fernando Sáenz Pérez wrote:
> Repeating the single quote seems to behave the same as for escaping the quote, and I use to escape this way.> Might it be because of the 32bit architecture?
The escape sequence does not depend on the architecture, it is per the language reference (T-SQL) for single-quoted string literals.
On the other hand, as for the rules for identifiers, there is a QUOTED_IDENTIFIERS option to take into account (the behaviour you are seeing goes with the default value):HTH,Julio
--
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.
insert_child(Child, Mother, Father, Affected) :- odbc_query(parents, 'INSERT INTO parents (name,mother,father) \ VALUES ("mary", "christine", "bob")', affected(Affected)).
On 1/06/2016, at 12:25 am, Fernando Sáenz Pérez <fsaen...@gmail.com> wrote:Hello,With Windows 10 64 bit, SQL Server 2014 64bit, and 64bit ODBC driver manager with SQL Server Native Client 11.0 (2011.110.3000.00) (the platform is listed as 32bit/64bit, which means that the same connection can be used from both, as I checked), the same issue remains:4 ?- test(X).ERROR: ODBC: State S1003: [Microsoft][Administrador de controladores ODBC] Tipo de programa fuera de intervalo^ Exception: (9) setup_call_catcher_cleanup(user:odbc_connect(sqlserver, '$odbc_connection'(26751756), []), user: (odbc_query('$odbc_connection'(26751756), 'create table t(a date)', _G26335), odbc_query('$odbc_connection'(26751756), 'insert into t values(\'2016-05-31\')', _G26342), odbc_query('$odbc_connection'(26751756), 'select a from t', _G26259, [types([date])])), _G26425, user:odbc_disconnect('$odbc_connection'(26751756))) ?>> Perhaps this is a problem that has nothing to do with Prolog or odbc4pl and everything to do with Fernando's setup?I'm not sure. I did another test, this time with PostgreSQL 9.5.1 (PostgreSQL ODBC Driver ANSI 9.05.01.00) and first, SICStus Prolog 4.3.1 64bit and, second, with SWI-Prolog 7.2.3 64 bit. The first went fine but the second raised the same error. If the issue would come from the OS/ODBC/DBMS setup, I think that the same issue would be revealed in both Prolog systems, but it doesn't.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
All the best,Fernando
> <mailto:swi-prolog+unsub...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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+unsub...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.
--
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.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.
--