SQL problem with SWI-Prolog

From: fickle (gices_at_lycos.com)
Date: 10/20/04


Date: 19 Oct 2004 20:15:24 -0700

Hello ...

Im trying to use Prolog to make a connection with a database and then
execute an SQL query with a WHERE clause. I am currently using
SWI-Prolog and MS-Access for this. I managed to execute simple SQL
queries but my precidates always fail when i specify a WHERE clause.
The predicate is as follows:

conn :- odbc_connect('credit',_,[alias(ccc),open(once)]),
odbc_prepare(ccc, 'SELECT name, postcode FROM credit_history where ID
= ?', [default], Z, [default]),
odbc_execute(Z, ['3']).

1 ?- conn.
ERROR: odbc_prepare/5: Caught signal 11 (segv)

Basically i got a table named credit_history and i would like to list
the name and postcode of the person whose ID is number 3. Can anybody
help me with this please?

Thanks,
fickle



Relevant Pages

  • Re: What is the technique to supply a list of values to a where clause?
    ... the where clause has a "column in list" clause. ... When I try to run the code, DBI returns an error saying that the value ... execute with 10 variables when 2 were needed. ... element in the ArrayTupleStatus and in some cases it does not help ...
    (perl.dbi.users)
  • Re: user permissions
    ... I would like to add some comments regarding 'EXECUTE AS' clause in SQL ... Server 2005 as a complement of Rick's response. ... Microsoft Online Community Support ...
    (microsoft.public.sqlserver.security)
  • Re: Do all the legs of an "OR" with null comparisons get executed?
    ... I did MMDDOB=1231, whenever MMDDOB was NULL the row would be filtered ... The WHERE clause is not working the way you expect, ... Placing as Oracle would evaluate the WHERE clause: ... going to execute something that reads ...
    (comp.databases.oracle.server)
  • Re: Reusing the result of an expression in select query
    ... Orlando Amador schrieb: ... This has created a very big SQL query. ... Looks like With clause is for 10.2? ... Any suggestions for Oracle 9? ...
    (comp.databases.oracle.server)
  • C# Paradox Database odbc
    ... I set up the connection using the wizards and in Server Explorer I can see ... If I do a SQL Query, ... Error in SELECT clause: expression near '''. ... Unable to parse query test. ...
    (microsoft.public.data.odbc)