Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Swapping Values in Two Columns
Message
From
03/09/2013 08:57:00
 
 
To
03/09/2013 08:50:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01581882
Message ID:
01581886
Views:
49
>>I'm trying to switch the values from two columns. Here's my code:
>>
>>
update Items;
>>   SET cDesc = cIntDesc ;
>>   , cIntDesc = cDesc
>>
>>This is a VFP database.
>>
>>Shouldn't that work?
>>
>>What is happening is that both columns get the original value that was in cIntDesc.
>
>That's what I'd expect. This is the same as if you'd written:
>
>
>x=y
>y=x
>
>
>The changes have to occur in some order. You'll have to use a variable to hold one value temporarily.
>
>Tamar

I understand. I just had a very strong memory of using code like this before. Maybe it was on a SQL Server database which apparently allows you to do this.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform