Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert Into only missing records
Message
From
22/11/2004 20:13:14
 
 
To
22/11/2004 19:40:06
Arthur Evangelista
David-Link Corporation
Makati, Philippines
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00963687
Message ID:
00963694
Views:
7
Hello,

i think in VFP 9 you can do

INSERT INTO Transactions FROM (SELECT * FROM otherTable WHERE NOT EXISTS (SELECT primaryKey FROM Transactions WHERE Transaction.primaryKey = otherTable.primaryKey))

in current versions you may just use ..

SELECT * FROM otherTable WHERE NOT EXISTS (SELECT primaryKey FROM Transactions WHERE Transactions.primaryKey = otherTable.primaryKey) INTO CURSOR missingRecs

SELECT Transactions
APPEND FROM DBF('missingRecs')

Regards

Christian
Previous
Reply
Map
View

Click here to load this message in the networking platform