Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Merging two cursors with same structure
Message
From
01/06/2010 11:14:57
 
 
To
01/06/2010 11:02:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01466869
Message ID:
01466880
Views:
62
>I want to add the content of a cursor to another cursor. The two cursors have the same fields.
>
>It would be quite simple to do this by code but I'm wondering if there is a VFP command to do that?
insert into One select * from Two
In case you only want records that don't exist
	create cursor One ;
	(	pk  I )
	for i = 1 to 10 
		insert into One values (m.i)
	endfor
	
	create cursor two ;
	(	pk  I )
	for i = 5 to 20 
		insert into two values (m.i)
	endfor
	
	&& add 11 to 20, since 5 to 10 are already in
	insert into One ;
		select * from Two ;
			where not exists (select pk from One where (One.pk == two.pk))
	select One

	brow
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform