Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Easier way to perform this?
Message
 
 
À
28/06/2004 19:00:52
Luis Navas
Independent Consultant
Auckland, Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00918194
Message ID:
00918233
Vues:
7
Luis,

In VFP8 it's simple:
create cursor x1 ( i1 i )
insert into x1 values ( 1 )
insert into x1 values ( 2 )
insert into x1 values ( 3 )
insert into x1 values ( 4 )

create cursor x2 ( i1 i )

insert into x2 values ( 2 )

insert into x2 ;
   select i1 ;
   from x1 ;
   where not exists ( select i1 from x2 where x2.i1 = x1.i1 )
>Hi, I'm inserting records from one table into another, but I only have to insert those record that aren't in the destination table. Now I'm doing it like this:
>
>
>*!* Source Table
>Select Table1
>Scan
>   lnId=Table1.Table1Id
>   If !Seek(lnId,"Table2")
>       Insert Into Table2 (id) Values (lnId)
>   EndIf
>EndScan
>
>
>
>Is There any easy way?, for example a combination of Insert and Select
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform