Re: SWI-Prolog with mySQL



On 2007-11-04, Philipp Kraus <philipp.kraus@xxxxxxxxxxxx> wrote:
Hi @all,

I had coded a routing system. My database is stored in a seperate
txt-file, which is included dynamicly, but now I would like to store
the data in a mySQL table and call them.

Is there any solution to run the SQL statement without unixODBC?

Not that I'm aware of, though it is not unlikely someone hacked
something together. The short route is of course to use unixODBC, which
is readily available for most platforms. The longer route is to write a
low-level interface using the mySQL client library and SWI-Prolog
foreign language interface. I don't know the mySQL client interface, but
a simple interface to answer basic SQL queries is probably not very
hard.

The whole lot generally is quite a bit of work, notably to realise a
good and programmable mapping between database types and Prolog types,
deal with transactions, etc. Doing all this work is probably only
justified if you need the performance gain that will probably result
from bypassing ODBC (I have no clue how large the overhead is) or you
want to distribute your program to a community where setting up unixODBC
adds a major hassle.

Can anyone post an example?

The odbc interface is -of course- part of the sources. It will give
you a clue how much work is involved doing a fairly complete interface.
I'd expect a straight mySQL interface to be a bit smaller and simpler
as the ODBC version has to take care of different capabilities of the
actual driver as well as bugs in some drivers.

--- Jan


Thanks a lot

Phil

.



Relevant Pages

  • Re: Standard DBI Proposal
    ... I find the lack of an ODBC driver on non-Windows ... an SQL layer over just such an ODBC ... If you're asserting that Tcl entirely lacks an interface to ODBC ... we will be living with multiple database ...
    (comp.lang.tcl)
  • Re: MCP and SQL
    ... provides an ODBC driver interface. ... DMSQL provides the SQL CLI interface, which is also very similar to the ODBC ... but only interfaces to a local DMSII or SQL database. ...
    (comp.sys.unisys)
  • Re: ADO.net Code contest
    ... Ah, actually, accessing an Access database is done through JET. ... generic interface like OLE DB or ODBC from any data access interface ... ODBC, OLE DB are ...
    (microsoft.public.dotnet.framework.adonet)
  • variations
    ... odbc to interface with an sql server 2005 database? ... I need to program a database layer, and I know there are idiosyncracies ...
    (microsoft.public.sqlserver.odbc)
  • Re: Beginning C# Q
    ... starting out with a network app0lication, you have an awful lot to swallow. ... Designing your database is therefore, not quite the first step, particularly ... Groups table, which defines which Groups users belong to, and a Permissions ... That is why an Interface is called an Interface. ...
    (microsoft.public.dotnet.framework)