Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UPDATE the same field twice in one statement
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01433681
Message ID:
01433683
Views:
69
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform