Re: Dealing with large datasets

Blake McBride <[email protected]> Thu, 11 Feb 2016 11:03:39 -0600
Newsgroups gmane.lisp.clsql.general
Message-ID <CABwHSOviUhKUSAT4BYjzJTCDJLVayzg7vURcYwDPRMG5X89SuQ@mail.gmail.com>
--===============4663582097564750371==
Content-Type: multipart/alternative; boundary=001a11416af8345733052b818842

--001a11416af8345733052b818842
Content-Type: text/plain; charset=UTF-8

Yea, that is what I suspected and feared.  I think adding cursors would not
be hard, but it would be a little more involved than you suggest.  Right
now you have:

database -> data

You need:

database -> cursor -> data

So, you would obtain a cursor object from a database object, and then all
of your operations would be on the cursor object rather than a database
object.  Of course, you can create any number of cursor objects against a
single database connection thus solving the two problems I mentioned.

Few things would give me more pleasure then getting into the code myself.
In fact I've done a bit of contributing in the past (
https://github.com/blakemcbride?tab=repositories ) but time is a huge
problem for me right now.

I really appreciate all of your and others great work with CLSQL.  It would
be great to see cursors some time.

Lastly, with lisp packages, I think lisp would do fine with a many
programmer application.

Thanks.

Blake McBride


On Thu, Feb 11, 2016 at 10:48 AM, Russ Tyndall <[email protected]>
wrote:

> Just ran a quick test of nested queries:
>
> (with-a-db-role (:dev-old)
>   (clsql:do-query
>     ((acct)
>      "SELECT accountid FROM clients")
>     (clsql:query
>      #?"SELECT companyname FROM clients WHERE accountid=${acct}")))
>
> Which resulted in a error:
> A database error occurred: NIL / 24000
>   [unixODBC][FreeTDS][SQL Server]Invalid cursor state
>    [Condition of type CLSQL-SYS:SQL-DATABASE-ERROR]
>
> So the most basic nested query does NOT seem to work right now. Again I
> feel like there are probably some fiddly C bits to align and/or resource
> manage better, and it *could* work, but probably not something I will ever
> get around to developing gratis.
>
> Russ Tyndall
> Programmer
> Acceleration.net
>
>
> On 02/11/2016 11:33 AM, Russ Tyndall wrote:
>
>>
>> As for nested queries,  they may work just fine (probably do), I really
>> have never needed them, and so don't want to really commit to it.  My guess
>> is that it would come down to how the internals are handling the C bits,
>> which is probably mostly correct.  I use separate connections for things
>> like writing logging outside of the current transaction, so they are
>> required.
>>
>
>
> _______________________________________________
> CLSQL mailing list
> CLSQL-2NDrxpH/[email protected]
> http://lists.kpe.io/cgi-bin/mailman/listinfo/clsql
>

--001a11416af8345733052b818842
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yea, that is what I suspected and feared.=C2=A0 I think ad=
ding cursors would not be hard, but it would be a little more involved than=
 you suggest.=C2=A0 Right now you have:<div><br></div><div>database -&gt; d=
ata</div><div><br></div><div>You need:</div><div><br></div><div>database -&=
gt; cursor -&gt; data</div><div><br></div><div>So, you would obtain a curso=
r object from a database object, and then all of your operations would be o=
n the cursor object rather than a database object.=C2=A0 Of course, you can=
 create any number of cursor objects against a single database connection t=
hus solving the two problems I mentioned.</div><div><br></div><div>Few thin=
gs would give me more pleasure then getting into the code myself.=C2=A0 In =
fact I&#39;ve done a bit of contributing in the past (=C2=A0<a href=3D"http=
s://github.com/blakemcbride?tab=3Drepositories">https://github.com/blakemcb=
ride?tab=3Drepositories</a> ) but time is a huge problem for me right now.<=
/div><div><br></div><div>I really appreciate all of your and others great w=
ork with CLSQL.=C2=A0 It would be great to see cursors some time.</div><div=
><br></div><div>Lastly, with lisp packages, I think lisp would do fine with=
 a many programmer application.</div><div><br></div><div>Thanks.</div><div>=
<br></div><div>Blake McBride</div><div><br></div><div class=3D"gmail_extra"=
><br><div class=3D"gmail_quote">On Thu, Feb 11, 2016 at 10:48 AM, Russ Tynd=
all <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex">Just ran a quick test of nested queries:<br>
<br>
(with-a-db-role (:dev-old)<br>
=C2=A0 (clsql:do-query<br>
=C2=A0 =C2=A0 ((acct)<br>
=C2=A0 =C2=A0 =C2=A0&quot;SELECT accountid FROM clients&quot;)<br>
=C2=A0 =C2=A0 (clsql:query<br>
=C2=A0 =C2=A0 =C2=A0#?&quot;SELECT companyname FROM clients WHERE accountid=
=3D${acct}&quot;)))<br>
<br>
Which resulted in a error:<br>
A database error occurred: NIL / 24000<br>
=C2=A0 [unixODBC][FreeTDS][SQL Server]Invalid cursor state<br>
=C2=A0 =C2=A0[Condition of type CLSQL-SYS:SQL-DATABASE-ERROR]<br>
<br>
So the most basic nested query does NOT seem to work right now. Again I fee=
l like there are probably some fiddly C bits to align and/or resource manag=
e better, and it *could* work, but probably not something I will ever get a=
round to developing gratis.<span class=3D"HOEnZb"><font color=3D"#888888"><=
br>
<br>
Russ Tyndall<br>
Programmer<br>
Acceleration.net</font></span><span class=3D"im HOEnZb"><br>
<br>
<br>
On 02/11/2016 11:33 AM, Russ Tyndall wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<br>
As for nested queries,=C2=A0 they may work just fine (probably do), I reall=
y have never needed them, and so don&#39;t want to really commit to it.=C2=
=A0 My guess is that it would come down to how the internals are handling t=
he C bits, which is probably mostly correct.=C2=A0 I use separate connectio=
ns for things like writing logging outside of the current transaction, so t=
hey are required.<br>
</blockquote>
<br>
<br></span><div class=3D"HOEnZb"><div class=3D"h5">
_______________________________________________<br>
CLSQL mailing list<br>
<a href=3D"mailto:CLSQL-2NDrxpH/[email protected]" target=3D"_blank">CLSQL-2NDrxpH/[email protected]<=
/a><br>
<a href=3D"http://lists.kpe.io/cgi-bin/mailman/listinfo/clsql" rel=3D"noref=
errer" target=3D"_blank">http://lists.kpe.io/cgi-bin/mailman/listinfo/clsql=
</a><br>
</div></div></blockquote></div><br></div></div>

--001a11416af8345733052b818842--

--===============4663582097564750371==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQ0xTUUwgbWFp
bGluZyBsaXN0CkNMU1FMQGxpc3RzLmtwZS5pbwpodHRwOi8vbGlzdHMua3BlLmlvL2NnaS1iaW4v
bWFpbG1hbi9saXN0aW5mby9jbHNxbAo=

--===============4663582097564750371==--