Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update field
Message
From
04/08/2006 17:52:54
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01143071
Message ID:
01143111
Views:
11
Sorry to jump in here, but there is no FROM clause in the UPDATE command in version 8.0.

--------

I suggest a more conventional way.

1. Create an index on the ID field of the _tmp cursor.
SELECT _tmp
INDEX ON id TAG id
2. Execute this code
SELECT Table1
SET RELATION TO id INTO _tmp 
replace ALL table1.field1 WITH _tmp.field1
SET RELATION TO 
The relationship will move the _tmp cursor record pointer to always match up it's ID with the Table1 ID.


>>Seems I am too silly today ;(
>>The question is:
>>May I update one table from another without SCAN ? (like localview does it)
>>
>>code example
>>
>>select * from table1 into cursor _tmp READWRITE
>>
>>Then I modify one field in _tmp cursor .. and then I want to update Table1 with new modifications..
>>
>>SELECT _tmp
>>SCAN ALL
>>       SELECT table1
>>       LOCATE FOR table1.id = _tmp.id
>>       IF FOUND()
>>            replace table1.field1 with _tmp.field1
>>       ENDIF
>>SELECT _tmp
>>ENDSCAN
>>
>>
>>Maybe it possible to make for one command line? (I do not mean tableupdate and view)
>>
>>Sorry for this stupid question
>>Denis
>
>
UPDATE Table1 SET table1.field1 = _tmp.field1 FROM _tmp WHERE table1.id = _tmp.id
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform