Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Update
Message
From
20/04/1999 15:02:19
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00210164
Message ID:
00210251
Views:
24
>In Access, my husband updated the values in one table based on the values in another table by putting a JOIN in the SQL. I figured it would be the same in VFP, but I can't figure out how to do it. I don't remember his exact syntax, so I don't know if I'm doing it wrong, or if VFP doesn't support this.
>
>Basically, I'm trying to do:
>
>UPDATE table1
>SET table1.field1 = table2.field2
>WHERE table1.key = table2.key
>
>So how do I do this?
>
>Thanks,
>
>-Michelle
As Don mentioned, VFP's SQL update is not exactly SQL-standard in that it doesn't support what you want to do. Multi-row update support would be nice, too. An alternative to your situation is to use the seek() function on your Where clause like so:
UPDATE Table1 SET tbl1.fld1 = tbl2.fld2 WHERE Seek(tbl1.keyfld1, "tbl2")
Of course you would need the index on the second table. HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform