Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to combine two cursors?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01411721
Message ID:
01411759
Views:
74
This message has been marked as a message which has helped to the initial question of the thread.
>>
>>select * from myFirstCursor
>>UNION
>>select * from mySecondCursor
>>into cursor curCombinedResults
>
>I get error that the "operation is invalid for a Memo, Blob, General or Picture field". My cursors do have a MEMO field. So the UNION cannot be used when a cursor has a MEMO, right?

Right. Include all fields except for a memo, or you would need to use UNION ALL (but this would not eliminate duplicates).

Alternative solution would be
select * from myFirstCursor
UNION ALL
select MySecond.* from mySecond LEFT JOIN myFirstCursor ;
on mySecond.ID = myFirstCursor.ID where myFirstCursor.ID IS NULL
The second select selects only records that are not found in first cursor.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform