comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <b.f.lundin@gmail.com>
Subject: Re: Compiling GNATColl on Windows
Date: Tue, 16 Dec 2014 09:48:16 +0100
Date: 2014-12-16T09:48:16+01:00	[thread overview]
Message-ID: <m6orjs$h7n$1@dont-email.me> (raw)
In-Reply-To: <1ifoukt5d2s2z$.6d9y7y2fiufo$.dlg@40tude.net>

On 2014-12-15 23:37, Dmitry A. Kazakov wrote:
> 
> Roughly same in ODBC:
> 
> declare
>    Environment : aliased ODBC_Environment;
>    Connection : aliased ODBC_Connection (Environment'Access);
> begin
>    Connect (Connection, "My_DB", "Myself", ...);
>    declare
>       Command : aliased ODBC_Command (Connection'Access);
>    begin
>       Prepare (Command, "SELECT COL1,COL2 FROM ...");
>       Execute (Command);
>       Fetch (Command);
>       Some_Variable := Get (Command'Access, 1, On_Error);
>       Some_Other_Variable := Get (Command'Access, 2, Always);
>    end;
> end;
> 
> No need to fiddle with cursors explicitly and nothing to commit, if only
> reading.


Actually you do need to fiddle with server-side cursors sometimes.
Like if you have a very large table and want to treat all rows.

I've got a simulation program that reads a table of 30_000_000 rows,
that are recordings from actual events since this June.

The simulation reads the data in timestamp order (which is a field in
the table) and tries different algorithms on the data.
The outcome is somewhat based on previous outcome, so I do not want
to split the recordset.

The one with best outcome survives ans is tried in real life later on.

But the table grows, and I expect it to be ca 33 M rows at the ens of
the year. And next year, if I record the whole year, I'll end up with
60M+ rows.

For that, I _really_ like cursors on the server side.
It seems like your ODBC reads the whole recordset into the clients memory?

Or do I misunderstand it?



--Björn


  parent reply	other threads:[~2014-12-16  8:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15 13:06 Compiling GNATColl on Windows mhardeman25
2014-12-15 13:25 ` Michael Hardeman
2014-12-15 15:47   ` David Botton
2014-12-15 15:49     ` David Botton
2014-12-15 16:10       ` Michael Hardeman
2014-12-15 21:55         ` Björn Lundin
2014-12-15 22:37           ` Dmitry A. Kazakov
2014-12-15 23:14             ` Björn Lundin
2014-12-16  8:48             ` Björn Lundin [this message]
2014-12-16 10:10               ` Dmitry A. Kazakov
2014-12-16 10:21                 ` Björn Lundin
2014-12-15 23:00           ` Björn Lundin
2014-12-15 16:09     ` Michael Hardeman
2014-12-15 19:46 ` Shark8
2014-12-16 17:50   ` Michael Hardeman
2014-12-16 20:27     ` Björn Lundin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox