Information générale
Catégorie:
Codage, syntaxe et commandes
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement