Re: [eclipse-clp-users] database interface

From: Kish Shen <kisshen_at_cisco.com>
Date: Wed, 29 Oct 2008 13:03:30 +0000
Hi Carlo,

I am not sure I completely understand the background to your question -- 
did you find the documentation for lib(dbi) in the manuals? There is a 
chapter on it in the Embedding and Interfacing manual (with ECLiPSe 6.0; 
it used to be in the Constraints Library manual in 5.10), which should 
tell you to do what you are asking:

http://www.eclipse-clp.org/doc/embedding/embroot059.html

Did you not find this documentation (it may be a little hard to locate), 
or did you have problems with the manual description?

To do what you want, you would issue the SQL query using 
session_sql_query/4, and then use cursor_next_tuple/2 to retrieve your 
results -- this returns the tuples that matches your query one tuple at 
a time, which seems to be what you want.

Cheers,

Kish

Carlo Matteo Scalzo wrote:
> Hi everybody, i'm new to this mailing list.
> 
> I just discovered the eclipse database interface (dbi).
> 
> I'd like to use this interface to define a predicate that enumerates on
> backtracking all the tuples returned by a SQL query.
> 
> Suppose i have a mysql database composed by a single table Student(name,
> age),  where 'name' is a string and 'age' is an integer.
> 
> I'd like to have a predicate student(Name, Age) that enumerates on
> backtracking all the tuples returned by the SQL query "select * from
> Student".
> 
> Can someone please help me ?
> 
> Thanks in advance.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Wed Oct 29 2008 - 13:03:37 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET