Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert / Update
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01503367
Message ID:
01503370
Views:
61
Something like
INSERT INTO TableA
SELECT * FROM TableB 
WHERE PK NOT IN (SELECT PK FROM TableA)
>Is there a way to “update” a table from another table appending or inserting only items that are not already in the target table with one function?
>Currently I create a cursor containing only those values not already in the target table, then scan it and do the insert function.
>
>This seems a little like brute force. Is there a more elegant way?
>
>I was looking at Update – SQL, but it seems it can only change existing field values.
>
>I was thinking something along these lines;
>
>Insert into A ;
>(F1, F2, F3) ;
>Where !F1 IN (select B.F1 from B)
>Values ;
>(B.F1, B.F2, B.F3)
>
>Thanks in advance
>
>Gary
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform