Re: [fpc-pascal] TSQLQuery and buffering.

2017-04-12 Thread noreply
On 2017-03-24 14:42, Gary Doades wrote: Hi everyone, Firstly, I realise this is an old subject, but I still can't find any easy answer. Really, the question is simple: Is there ANY way of TSQLQuery NOT reading the entire result set into memory? What about making multiple queries and setting

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread Gary Doades
On Mon, 27 Mar 2017, Gary Doades wrote: >> The problem therefore lies in either the Pascal layer on top of the native >> client libs or in the way the client libs themselves work :( I suspect the >> latter. > As far as I know, the DB-Specific pascal layer does not buffer anything, it > just

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread Michael Van Canneyt
On Mon, 27 Mar 2017, Gary Doades wrote: Indeed, that's why I can't currently see where the problem lies. It shouldn't buffer the rows/records, but it does... or at least something does and I'm pretty sure it's not my program. The DB-client library maybe? Yup! I was running some other

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread Gary Doades
> >> Indeed, that's why I can't currently see where the problem lies. It >> shouldn't buffer the rows/records, but it does... or at least >> something does and I'm pretty sure it's not my program. > The DB-client library maybe? Yup! I was running some other tests and copied the table contents

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread Martin Schreiber
On Monday 27 March 2017 10:20:20 Gary Doades wrote: > >> It may be that UniDirectional is meant to not buffer all rows, but at > >> the moment it certainly seems to. > > > > Strange, looking at source code it seems to me, that buffering should not > > happen. As far as TUniDirectionalBufIndex

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread LacaK
It may be that UniDirectional is meant to not buffer all rows, but at the moment it certainly seems to. Strange, looking at source code it seems to me, that buffering should not happen. As far as TUniDirectionalBufIndex should be used and his AddRecord method does not allocate new memory.

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread Gary Doades
> >> It may be that UniDirectional is meant to not buffer all rows, but at the >> moment it certainly seems to. > Strange, looking at source code it seems to me, that buffering should not > happen. > As far as TUniDirectionalBufIndex should be used and his AddRecord method > does not allocate

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread LacaK
It may be that UniDirectional is meant to not buffer all rows, but at the moment it certainly seems to. Strange, looking at source code it seems to me, that buffering should not happen. As far as TUniDirectionalBufIndex should be used and his AddRecord method does not allocate new memory.

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread Gary Doades
> From your original message one could think that you were using > PacketRecords:=-1 which means fetch all records at once, but if you are using > the standard setting, which is 10 and yet it is still fetching everything at > once, it > sounds like a bug to me. As far as I can tell setting

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-27 Thread Martin Schreiber
On Sunday 26 March 2017 18:37:36 Michael Van Canneyt wrote: > > > Looking at the above unit, I can only presume you load the field directly > from the cursor returned by the native library. > Correct. > > As far as I can make out, TSQLResult is usable only for scanning a result > set. TDataset has

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-26 Thread Jesus Reyes A.
En Sat, 25 Mar 2017 02:32:33 -0600, Gary Doades escribió: Many thanks for your reply. I had read about UniDirectional and I have indeed tried this. It doesn't seem to make any significant difference. Looking through the source code for TBufDataset it looks like

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-26 Thread Michael Van Canneyt
r On Sat, 25 Mar 2017, Martin Schreiber wrote: On Saturday 25 March 2017 10:28:37 Michael Van Canneyt wrote: On Sat, 25 Mar 2017, Martin Schreiber wrote: > On Saturday 25 March 2017 09:32:33 Gary Doades wrote: >> I Understand about the "normal" use of TSQLQuery and data sets and I >> also use

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-26 Thread Michael Van Canneyt
On Sat, 25 Mar 2017, Gary Doades wrote: I had read about UniDirectional and I have indeed tried this. It doesn't seem to make any significant difference. Looking through the source code for TBufDataset it looks like UniDirectional just turns off building various indexes/structures etc. and

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Martin Schreiber
On Saturday 25 March 2017 10:28:37 Michael Van Canneyt wrote: > On Sat, 25 Mar 2017, Martin Schreiber wrote: > > On Saturday 25 March 2017 09:32:33 Gary Doades wrote: > >> I Understand about the "normal" use of TSQLQuery and data sets and I > >> also use this for small result set that need the

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Gary Doades
>> I had read about UniDirectional and I have indeed tried this. It doesn't >> seem to make any significant difference. Looking through the source code for >> TBufDataset it looks like UniDirectional just turns off building various >> indexes/structures etc. and fetches the result set all in one

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Gary Doades
> > MSEgui has TSQLResult for that purpose without the TDataset overhead. > https://gitlab.com/mseide-msegui/mseide-msegui/blob/master/lib/common/db/msesqlresult.pas Thanks. Although it looks interesting I'd rather not get into another set of classes etc. at this point. I may come back to it

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Michael Van Canneyt
On Sat, 25 Mar 2017, Gary Doades wrote: On Fri, 24 Mar 2017, Gary Doades wrote: Really, the question is simple: Is there ANY way of TSQLQuery NOT reading the entire result set into memory? Set Unidirectional to True, and it will keep only 1 row in memory. When you are simply scanning

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Michael Van Canneyt
On Sat, 25 Mar 2017, Martin Schreiber wrote: On Saturday 25 March 2017 09:32:33 Gary Doades wrote: I Understand about the "normal" use of TSQLQuery and data sets and I also use this for small result set that need the data changing some way and writing back to the DB. What I need now is an

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Martin Schreiber
On Saturday 25 March 2017 09:32:33 Gary Doades wrote: > > I Understand about the "normal" use of TSQLQuery and data sets and I also > use this for small result set that need the data changing some way and > writing back to the DB. What I need now is an equally convenient and > powerful way of

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Gary Doades
On Fri, 24 Mar 2017, Gary Doades wrote: > >> Really, the question is simple: Is there ANY way of TSQLQuery NOT >> reading the entire result set into memory? > Set Unidirectional to True, and it will keep only 1 row in memory. > When you are simply scanning through the result set, this is all

Re: [fpc-pascal] TSQLQuery and buffering.

2017-03-25 Thread Michael Van Canneyt
On Fri, 24 Mar 2017, Gary Doades wrote: Hi everyone, Firstly, I realise this is an old subject, but I still can't find any easy answer. Really, the question is simple: Is there ANY way of TSQLQuery NOT reading the entire result set into memory? Set Unidirectional to True, and it will