Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code to delete duplicate records
Message
De
01/07/1998 14:43:23
 
 
À
01/07/1998 14:41:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00113312
Message ID:
00113506
Vues:
30
>>>>vfp 3.0 and win 95
>>>>
>>>>I would like some suggestions for writing some
>>>>code to delete duplicate records that are created
>>>>on append and insert.
>>>>
>>>>I am working with clipper dbf files and have tried
>>>>literally everyway possible to prevent it from happening.
>>>>
>>>>Any thoughts?
>>>>
>>>>Thanks and have a good day!
>>>>
>>>>Becky
>>>
>>>Yet another method (assuming you're not using table buffering)...
>>>
>>>For this method to work, have index on jobnumber and SET DELETED ON.
>>>
>>>USE table
>>>USE table AGAIN IN 0 ORDER jobnumber table2
>>>SET RELATION TO jobnumber INTO table2
>>>SET SKIP TO table2
>>>
>>>With above relation set you can:
>>>
>>>DELETE FOR RECNO() > RECNO('table2')
>>>this will keep the first entry
>>>
>>>DELETE FOR RECNO() < RECNO('table2')
>>>this will keep the last entry
>>>
>>>BROWSE FOR RECNO('table2') # RECNO()
>>>to browse all duplicates so that you can see what's duplicated.
>>
>>This is very efficient, I like it. Just one quibble - delete all.
>
>Why DELETE ALL?
default scope of delete is next 1, the current record.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform