Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scatter and Gather
Message
From
12/11/2015 18:48:57
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
12/11/2015 18:16:28
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01627387
Message ID:
01627388
Views:
101
Luis,

Your delete and replace only need to execute once, but they are inside the scan which might suggest they get executed again for every row in mytemp. However, they only fire once because the record pointer is carried to EOF() by the Replace command, meaning the scatter/gather only gets done for the first row. In effect you're duplicating row 1 in teste and then updating some records in mytemp that has no effect on teste.

If the goal is to manipulate values and then add them to teste- then you could try
Select * From teste Into Cursor myTemp Readwrite where conta !="318"
*Delete For Conta = '318'
Replace Conta With '225111' For Conta = '321'
insert into teste select * from mytemp
If you want to update the existing rows in teste- then
Select teste
Delete For Conta = '318'
Replace Conta With '225111' For Conta = '321'
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform