Hi,
Normally I create a remote view with the wizard which returns all the rows.
I now need to limit what the remote view returns and do not see a way to manipulate the original view. I really don't want to create new views for every possible scenario. I just want to change the select statement.
The underlying sql table has 2 million rows and I need to process it 10000 rows at a time like with a top 10000.
I know how to do this as spt, but wanted to use the easyness of remote views...
in a .prg
use remoteview
modify the select statement in the remoteview and requery to get a subset
start processing.
Here is the code... (all in a standalone .prg) Its duty is to populate all 2 million sql rows by looking up the county_id (contained in both tables) and fill in the missing county name in the sql table (remoteview).
And, how do I edit the sql code I see when clicking the "view sqL" button within the view editor wizard, since it only lives in the database? What does its object path look like?
Thanks for any pointers and suggestions.
Stanley Barnett
Normally I create a remote view with the wizard which returns all the rows.
I now need to limit what the remote view returns and do not see a way to manipulate the original view. I really don't want to create new views for every possible scenario. I just want to change the select statement.
The underlying sql table has 2 million rows and I need to process it 10000 rows at a time like with a top 10000.
I know how to do this as spt, but wanted to use the easyness of remote views...
in a .prg
use remoteview
modify the select statement in the remoteview and requery to get a subset
start processing.
Here is the code... (all in a standalone .prg) Its duty is to populate all 2 million sql rows by looking up the county_id (contained in both tables) and fill in the missing county name in the sql table (remoteview).
Code:
Set Decimals To 0
Set Escape On
* load local vfp table
If !Used('county')
Use r:\Projects\vfp\Data\county.Dbf Shared
Endif
Select 'county'
Set Order To 'NATCODE'
aa = ''
lnCtr = 0
lnTotal = 0
* load remote view
If !Used('rv_mailinglist')
Use Domainstatus!rv_mailinglist In 0
Endif
Set Multilocks On
CursorSetProp("Buffering", 5, "rv_MailingList")
Select 'rv_MailingList'
* would like to change what is brought down
* SET FILTER TO ALLTRIM(county_code) = '25' && this works but way toooooo slow
Go Top
Do While !Eof('rv_MailingList')
lnCtr = lnCtr + 1
lnTotal = lnTotal + 1
If lnCtr >= 100
Wait Window Str(lnTotal) Nowait
lnCtr = 0
Select 'rv_MailingList'
qq = Tableupdate(.T.) && Stop every 100 rows and sync with backend...
Endif
aa = '16-' + Padl(Alltrim(rv_mailinglist.county_code), 3, '0')
Select 'county'
Seek aa In 'County'
If Found('county')
Replace rv_mailinglist.county_name With county.cnty_name
Endif
Select 'rv_MailingList'
Skip 1
Enddo
Tableupdate(.T.)
And, how do I edit the sql code I see when clicking the "view sqL" button within the view editor wizard, since it only lives in the database? What does its object path look like?
Thanks for any pointers and suggestions.
Stanley Barnett