Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple problem...
Message
 
 
À
29/08/2000 08:50:05
Mark B Littman
Personalized Software Solutions Inc.
Jensen Beach, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00410173
Message ID:
00410188
Vues:
16
>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.
>
>any ideas?


It's easy: don't run this code twice :)

Also you can check if records you are trying to add already exist in arinvt
by running following select

SELECT * FROM arinvt, temcopy1 ;
WHERE arinvt.whse = temcopy1.whse ;
AND arinvt.item = temcopy1.item ;
TO SCRREN NOCONSOLE

IF _TALLY > 0 than you've added records already
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform