Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append from cursor
Message
From
25/09/2017 13:19:55
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01654522
Message ID:
01654542
Views:
78
>Hi,
>
>How do you append from one cursor to another with FOR?
>
>I tried:
>
>select C_CURSOR1
>append from DBF("C_CURSOR2") fields FLD1, FLD2 FOR C_CURSOR2.FLD1 = "123"
>
>
>But it appends ALL records from the cursor C_CURSOR2 instead of just the ones matching the FOR
>
>What am I missing?

IIRC, the active record in cursor2 is not moving during the import. The for condition is applied to each record after it is inserted into c_cursor1. As each record is imported it looks at c_cursor2, and sees that the value matches and leaves the record in c_Cursor1. You'd need a relation between cursor1 and cursor2 for the record pointer in cursor2 to move.

To do it really obviously and cleanly,
select * from cursor2 where fld1="123" into cursor c_cursor3 nofilter
select c_cursor1
append from dbf("c_cursor3")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform