Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Implementing a Browse with SQL Pass Thru
Message
From
06/02/2002 11:03:50
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
05/02/2002 04:29:41
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00614848
Message ID:
00616074
Views:
37
Fernando

It is my understanding that progressive fetching and fetchasneeded are different. Fetchasneeded will only fetch records as needed. That is why a separate connection is needed. Progressive fetching will get all the records but will return control to VFP before completion. This can also create a problem because VFP can go to the next function and try and communicate with the DB and have a busy connection because records are still being fetched. You will need to check for a busy connection if you use progressive fetching. I almost forgot, you can't do fetchasneeded with SPT.

Personally, I don’t use progressive fetching for that reason. I have developed a philosophy that I try and limit the number of rows with each query to what is needed. All of my search screens give the user the ability to do the same. If the user does not limit the result set then the user will have to wait for the query to complete. They soon learn not to do that.

>I've been reading the docs and found in Microsoft Visual FoxPro 6.0 - Programmer's Guide - Chapter 22 (Optimizing Client/Server Performance) page 605:
>
>Using Progressive Fetching
>
>"When you query a remote data source, Visual FoxPro retrieves complete rows of data and builds a Visual FoxPro cursor. To speed retrieval of remote data, Visual FoxPro employs progressive fetching of view cursors and cursors created asynchronously with SQL pass-through. Rather than requiring you or your application to wait while an entire data set is retrieved, Visual FoxPro executes a query and fetches only a small subset of the result set rows into the local cursor. The size of this subset is 100 rows by default."
>
>"Note: Synchronous SQL pass-through statements don't employ progressive fetching. The entire result set requested by a SQLEXEC( ) statement is retrieved before control is returned to your application."
>
>"As Visual FoxPro retrieves additional rows of data, the local cursor contains increasingly more of the queried data. Since rows are retrieved at different times from the data source, the information in the rows isn't automatically current. If your connection is operating in asynchronous mode, Visual FoxPro returns control to you or your program as soon as it fetches the first subset of data. During idle time, Visual FoxPro performs a background fetch of the remaining rows in the queried data, one subset at a time, into the local cursor. This scenario allows you to use the already fetched data in the cursor without having to wait for the rest of the data."
>
>As I could understand, reading the above, I can use progressive fetching with SPT. Is that right? If so, how can it be implemented? Or there is a bug and it doesn't work at all?
>
>Thanks,
>
>Fernando
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform