Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UPDATE the same field twice in one statement
Message
From
07/11/2009 12:39:24
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
UPDATE the same field twice in one statement
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01433681
Message ID:
01433681
Views:
119
Hi,

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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform