Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a table based on a cursor
Message
From
14/01/2004 05:17:22
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00866620
Message ID:
00866627
Views:
21
Neil

you need to relate the tables using SET RELATION .

If they are related you do not need the FOR clause
Example:
Select maintable
SET ORDER TO mainkey &&Remeber that you need to have an index mainkey
select modacad
set relation to mainkey into maintable
set skip to maintable && if mainkey is not unique in maintable
replace maintable.mochk009 with mochk009 all
set skip to
set relation to
Select maintable
set order to
<pre>

Agnes
>I would like to update a table based on values within the cursor. Each record in the table has a field called 'mainkey' and the same in the cursor. I have a field namely mochk009 in the table and in the cursor. Therefore when I modify the cursor I then want to modify the table. My syntax is:
>
><PRE>
>SCAN
>replace modacad.mochk009 WITH result.mochk009 for result.mainkey=modacad.mainkey
>ENDSCAN
>
>
>I basically want to change modacad.mochk009 (table) with the value in the cursor (result) where the mainkey is both in modacad and result.
>
>Can anybody tell me what I am doing wrong?
>
>Many Thanks in advance.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform