Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Too slow to startup - ADO and ORACLE
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00495750
Message ID:
00495769
Vues:
12
>Hi, Thomas.
>
>Is there a way to populate my local recordset with just a few rows and then fetch the others only when needed? For example, a consumer table with 10000 rows in an Oracle Database, and a VFP client. I want to "navigate" through all the rows. In the initial fecth i bring 200 rows, and when I click the next button that will show me the 201st rows, the recordset (I think the recordset does this) brings 200 more rows, making the app "faster" ("smarter" would be better) and moving less rows through the network.
>
>In the "OraOLEDB Features" from Oracle is an explanation of the Connection String Attibutes and one of them is:
>
>FetchSize - specifies the size of the fetch array in rows.
>
>That´s way I use FetchSize=200.
>
>Thanks for helping! :)

You can try using the TOP clause in your SQL query.

select top 200 * from mytable order by < somevalue >

This will give you the first 200 rows based on the order you specify. If you order by last name, the query will give you the first 200 rows starting with 'A' and working up the alphabet.

After you get the first 200 rows, store the value of the order field for the last record. Then in your subseuent queries, use this value to get the next 200 rows.
local lclname
go bottom
lclname = resultset.lastname
select top 200 * from mytable where lastname > lcname order by lastname
If you are processing sequentially, this will solve your problem.

The backend will still process all 100,000 rows each time, but the amount of data passed over the wire back to you, will be limited.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform