Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scatter and Gather
Message
De
12/11/2015 18:48:57
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
12/11/2015 18:16:28
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01627387
Message ID:
01627388
Vues:
102
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform