Re: [eclipse-clp-users] Dbi Query with more than 1 columns

From: Edgaonkar, Shrirang <Shrirang.Edgaonkar_at_...390...>
Date: Fri, 30 Jan 2015 08:52:26 +0000
Dear Kish,

  Thanks for the reply.

For the sample script I used DOSEclipse for message. Following is the error message.

ECLiPSe Constraint Logic Programming System [kernel]
Kernel and basic libraries copyright Cisco Systems, Inc.
and subject to the Cisco-style Mozilla Public Licence 1.1
(see legal/cmpl.txt or http://eclipseclp.org/licence)
Source available at www.sourceforge.org/projects/eclipse-clp
GMP library copyright Free Software Foundation, see legal/lgpl.txt
For other libraries see their individual copyright notices
Version 6.1 #192 (x86_64_nt), Mon Oct  6 12:34 2014
[eclipse 1]: solve(Result).
*** Overflow of the global/trail stack in spite of garbage collection!
You are probably out of virtual memory (swap space).
Peak sizes were: global stack 13120 kbytes, trail stack 64 kbytes
Abort
[eclipse 2]:

Thanks and Regards,
Shrirang Edgaonkar
________________________________________
From: Kish Shen [kisshen_at_...5...]
Sent: 30 January 2015 16:36:02
To: Edgaonkar, Shrirang
Subject: Re: [eclipse-clp-users] Dbi Query with more than 1 columns

On 30/01/2015 02:11, Edgaonkar, Shrirang wrote:

>    Yes. That was a mistake but the problem is still the same. Even if the template is correct as per the documentation as follows, eclipse still crashes.

Did you or did you not get a crash from using the template with a
variable, i.e. tbl(A, 3)? If you did, did the test with a tuple with
only 1 specifying a single Prolog term column (i.e. the one with the
template like tbl(A)), succeed or not? I expect both of these to lead to
your program being aborted because dbi will throw a type error in both
cases. If this is not the case, please let me know what exactly happened
in both these cases.

Turning to your new examples with the correct template for string
xolumns, by crashing do you mean the TkECLiPSe window disappearing? If
so, did you see any messages?

If you did not see any messages, can you try reruning your program with
DosECLiPSe -- this should be available in the 'all programs' menu where
you can run TkECLiPSe, as DosECLiPSe is the alternative way of running
ECLiPSe, from a DOS shell. Hopefully there should be a better chance of
diaplaying any messages generated during the crash...

Cheers,

Kish


> SQL = "select enum, ename, esalary, ejob from employees where esalary > 1000",
> Template = emp(1234,"some name",1000.0,’some job’),
> session_sql_query(H, Template, SQL, Cursor),
> cursor_next_tuple(Cursor,Tuple),
>
> Following is the example I am running,.
>
> Table Structure:-
>
> CREATE TABLE `goodsinfo` (
>    `goodsid` int(11) NOT NULL,
>    `goodsname` char(100) DEFAULT NULL,
>    `price` double DEFAULT NULL,
>    `salesdate` datetime DEFAULT NULL,
>    `term` char(100) DEFAULT NULL,
>    `zaikoamount` double DEFAULT NULL,
>    `registerdate` datetime DEFAULT NULL,
>    `categoryid` int(11) DEFAULT NULL,
>    `searchViews` char(100) DEFAULT NULL,
>    PRIMARY KEY (`goodsid`)
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
>
>
> Eclipse script:-
>
> :- lib(dbi).
> solve(Result) :-
>
> session_start("root", "", [], Session),
> SQL = "SELECT goodsid, goodsname, term FROM simulator.goodsinfo",
> Template = goodsinfo1(101, "fdfdfddsdad", "dsdsadsds"),
> session_sql_query(Session, Template, SQL, Cursor),
> cursor_all_tuples(Cursor, Result),
> cursor_close(Cursor),
> session_close(Session).
>
> Since gooodsname and term are character string fields, eclipse will crash, whereas the following code will work.
>
>
> :- lib(dbi).
> solve(Result) :-
>
> session_start("root", "", [], Session),
> SQL = "SELECT goodsid, goodsname FROM simulator.goodsinfo",
> Template = goodsinfo1(101, "fdfdfddsdad"),
> session_sql_query(Session, Template, SQL, Cursor),
> cursor_all_tuples(Cursor, Result),
> cursor_close(Cursor),
> session_close(Session).
>
> Please help.
>
> Thanks and Regards,
> Shrirang Edgaonkar
>
> ______________________________________________________________________
> Disclaimer: This email and any attachments are sent in strictest confidence
> for the sole use of the addressee and may contain legally privileged,
> confidential, and proprietary data. If you are not the intended recipient,
> please advise the sender by replying promptly to this email and then delete
> and destroy this email and any attachments without any further use, copying
> or forwarding.
>

______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
Received on Fri Jan 30 2015 - 08:52:38 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:21 CEST