Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Merging two cursors with same structure
Message
De
01/06/2010 11:14:57
 
 
À
01/06/2010 11:02:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01466869
Message ID:
01466880
Vues:
63
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform