This task is very easy if you use a remote view, in the remote view properties, you can set up the number of records to fetch at a time and fetch remote data as needed. With SQLEXEC you need to set up the conection y asyncronus execution = .T., but you recive the data in several packages using SQLMORERESULTS.
The following example assumes SQLCONNECT( ) is successfully issued,
and its return value is stored to a memory variable named gnHandle. SQLSETPROP( ) is used to set the BatchMode property to False (.F.)
so the individual result sets can be retrieved.
SQLMORERESULTS( ) is issued twice to create two cursors containing the results of the SQLEXEC( ) query.
SET is used to display the View window and the cursors created by SQLEXEC( ).
= SQLSETPROP(gnHandle, 'BatchMode', .F.) && Individual result sets
= SQLEXEC(gnHandle, 'SELECT * FROM authors;
SELECT * FROM titles')
= SQLMORERES(gnHandle) && First result set
= SQLMORERES(gnHandle) && Second result set
I prefer the remote view because I can retrieve the whole package in one cursor.
Carlos A. Miranda
E.I.S.lnc
President