Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating records in FoxPro tables
Message
 
 
À
05/10/2001 16:50:58
Leshel Rich
Plains Cotton Coop Assoc
Lubbock, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00565010
Message ID:
00565029
Vues:
21
>I have some dupe records that are causing me problems and I need to delete one of the dupes for each record in several tables. Is there a way to do that without deleting each individual record by hand? Is there a way to do it using the command line?

Build exe from following code and you can run it from command line.
Select Mytable
Set Order To Keyfield
lKeyfiled = Null
SCAN
    IF lKeyfield= Mytable.Keyfield
        Delete
    ELSE
        lKeyfield= Mytable.Keyfield
    ENDIF
ENDSCAN
This code assumes that you have an index on Keyfield and you want to keep the first of the dup records
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform