Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting records
Message
 
À
05/05/2003 01:22:37
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00784786
Message ID:
00784918
Vues:
18
This message has been marked as the solution to the initial question of the thread.
>Hi everybody.
>For deleting records from the batch file, I use following code
>
>SELECT filename
>SET ORDER TO fieldname
>SET KEY TO expr
>GO TOP
>SCAN
>	DELETE
>ENDSCAN
>SET KEY TO
>SET ORDER TO
>
>I have tested it and it works, but I am not 100% sure if the code is safe? Somewhere in my mind I have a doubt, because I am filtering the records, then fetching the records one by one and deleting it. Will SCAN...ENDSCAN lose the reference of the records as any time? Am I going to confuse the fox in any case? What are the other safe ways? I cannot use DELETE ALL FOR.., because the tables and on the network and this will lock the entire file.
>Thanks.

Your code looks good, sometimes I have used:
DO WHILE SEEK(lcSomeKey)
DELETE
ENDDO
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform