Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP new bug: UPDATE with SET RELATION fails
Message
 
 
To
01/12/2001 15:17:19
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00588420
Message ID:
00588822
Views:
26
Andrus,
I don't understand why you think you need the relation and the EOF() check. If you simply use the following:
UPDATE Cursor1 ;
    SET Field1=Field1 ;
    WHERE Field1 in (select field1 from RCursor)
It appears to do what you need and that is update all records in Cursor1 with a matching record in RCursor. Unless you are running an internal function that updates something in RCursor during the Update statement, I don't think you need it.

HTH.

>Please confirm, is this VFP bug ?
>
>
>CREATE CURSOR Cursor1 ( Field1 c(10) )
>INSERT INTO Cursor1 VALUES ('HLADU' )
>INSERT INTO Cursor1 VALUES ('POOD')
>
>CREATE CURSOR RCursor ( Field1 c(10) )
>INSERT INTO RCursor VALUES ( 'HLADU' )
>INDEX ON Field1 TAG T
>
>SELECT Cursor1
>SET RELA TO Field1 INTO RCursor
>
>UPDATE Cursor1 ;
>    SET Field1=Field1 ;
>    WHERE !EOF('RCursor') AND ;
>       Field1 IN (SELECT Field1 FROM RCursor )
>* Result: 0
>* Expected result: 1
>messagebox( STR(_TALLY) )
>
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform