Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UPDATE the same field twice in one statement
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01433681
Message ID:
01433683
Vues:
68
You can do it in one update
UPDATE MYTABLE SET MYFLD1 = MAX(MYFLD1 - nValue1) + nValue2 WHERE Pk = nPkValue
>
>I need to have an UPDATE command that will update the same field twice. For example,
>
>
>UPDATE MYTABLE SET MYFLD1 = MAX(MYFLD1 - nValue1), SET MYFLD1 = MYFLD1 + nValue2 WHERE Pk = nPkValue
>
>
>How does VFP and SQL Server process this? Can I rely that the field MYFLD1 will be update in the order it appears in the UPDATE expression? Or is it better to have 2 UPDATE statements, in order to make sure that the order of update is correct (as far my need).
>
>Thank you in advance for any help.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform