Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine 2 or more cursors
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00568592
Message ID:
00568613
Views:
17
Doron,
You could try something like this:
*-- create some test data
CREATE CURSOR CursorA (aaa C(10), bbb C(10))
CREATE CURSOR CursorB (ccc C(10))
FOR i=1 TO 100
	INSERT INTO CursorA VALUES("aaa"+ALLTRIM(STR(i)),"bbb"+ALLTRIM(STR(i)))
ENDFOR &&* i=1 TO 100
FOR i=1 TO 100
	INSERT INTO CursorB VALUES("ccc"+ALLTRIM(STR(i)))
ENDFOR &&* i=1 TO 100

*-- create combined cursor
CREATE CURSOR CursorC (aaa C(10), bbb C(10), ccc C(10))

GO TOP IN CursorB
SELECT CursorA

SCAN
	SCATTER MEMVAR MEMO
	SELECT CursorB
	SCATTER MEMVAR MEMO
	SKIP IN CursorB
	INSERT INTO CursorC FROM MEMVAR
ENDSCAN
>Hi All,
>
>I have 2 Cursors:
>Cursor A: aaa bbb ccc
>Cursor B: ddd eee fff
>
>I want to combine the two cursors into 1 cursor:
>Cusror C: aaa bbb ccc ddd eee fff <--- This is one new record
>
>I don't have an id per each cursor since cusor A or cursor B could be
>a JOIN of other tables as well.
>
>I could create an id per each cursor but that may take time if I have
>200,000 records per each cusror. Also I can not do an sql on the RECNO()
>of each cursor(that could be good). Each cursor has same amount of records.
>
>Any ideas are appreciated.
>
>Regards,
>
>Doron
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform