Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Make code shorter
Message
De
11/11/2005 09:29:52
 
 
À
10/11/2005 12:44:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01066789
Message ID:
01067619
Vues:
26
>>I agree with Larry that you should put the values in a cursor or table. But you don't a loop after that. Use UPDATE or REPLACE together with the LOOKUP() function to do it in one statement.
>
>Tamar,
>
>thank you.
>Can you provide sample code which produces exactly the same results as those
>update statements ?


Assume you've created a cursor called Replacements with two columns: OldVal and NewVal.

I didn't notice originally that you're actually changing multiple columns, but you should be able to do something like:

SELECT Replacements
UPDATE Tallamat ;
SET c30 = LOOKUP(NewVal, Tallamat.c30, OldVal), ;
SET c35 = LOOKUP(NewVal, Tallamat.c35, OldVal), ;
...

This is untested, so you may have to fiddle with it some to get it just right.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform