Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update SQL Syntax
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01135906
Message ID:
01135909
Views:
13
This message has been marked as the solution to the initial question of the thread.
No it doesn't work. It updates Box table using a current record in the NewLocation table (w/o moving record pointer in the NewLocation table). Run your code with small modification I made to see for yourself.
The following does work
CREATE CURSOR Box (box c(10), freezer c(10))
INSERT INTO Box (box, freezer) VALUES ("1","123")
INSERT INTO Box (box, freezer) VALUES ("2","999")
INSERT INTO Box (box, freezer) VALUES ("3","999")

CREATE CURSOR NewLocation (box c(10), freezer c(10))
INSERT INTO NewLocation (box, freezer) VALUES ("2","222")
INSERT INTO NewLocation (box, freezer) VALUES ("3","333")
INSERT INTO NewLocation (box, freezer) VALUES ("1","111")
INDEX ON box TAG box

SELECT Box
UPDATE Box SET freezer = NewLocation.freezer WHERE SEEK(Box,  "NewLocation", "box")
In VFP9
UPDATE Box SET freezer = NewLocation.freezer ;
	FROM Box ;
	JOIN NewLocation ON Box.Box = NewLocation.Box
>Here you have an example (partial) that is working
>CREATE CURSOR Box (box c(10), freezer c(10))
>INSERT INTO Box (box, freezer) VALUES ("1","123")
>INSERT INTO Box (box, freezer) VALUES ("2","999")
>INSERT INTO Box (box, freezer) VALUES ("3","999")
>CREATE CURSOR NewLocation (box c(10), freezer c(10))
>INSERT INTO NewLocation (box, freezer) VALUES ("2","123")
***
SKIP
***
>SELECT Box
>UPDATE Box SET freezer = NewLocation.freezer WHERE Box = NewLocation.box
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform