Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easier way to perform this?
Message
 
 
To
28/06/2004 19:00:52
Luis Navas
Independent Consultant
Auckland, New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00918194
Message ID:
00918233
Views:
6
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
Previous
Reply
Map
View

Click here to load this message in the networking platform