Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple problem...
Message
 
To
29/08/2000 08:50:05
Mark B Littman
Personalized Software Solutions Inc.
Jensen Beach, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00410173
Message ID:
00410236
Views:
14
Hi Mark,
>I have an item/whse file that may contain 5000 item/warehouse records. I want to copy all items from warehouse "000" to warehouse "099". This is easy enough using the following code:
>
>Use arivt
>select * from arinvt where whse = "000" into table tempcopy1.dbf
>use tempcopy1
>replace whse with "099" all
>close all
>use arinvt
>append from tempcopy1
>
>this works great...however...if you run it twice it duplicates all the records in the file...how can I avoid duplications?
>
>I have several indexes...item/whse that are set to unique and/or primary...but this does not solve the problem.
>

If you only want the Items that are newly added try something like this:
SELECT * FROM ArInvt;
WHERE Whse = "000;
AND ItemNbr NOT IN (SELECT ItemNbr FROM ArInvt WHERE Whse = "099");
INTO TABLE TempCopy1.Dbf
HTH,
Bill Armbrecht
VFP MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform