Information générale
Catégorie:
Codage, syntaxe et commandes
>>>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement