Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DELETE command?
Message
From
19/01/2007 14:36:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
19/01/2007 13:44:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01187102
Message ID:
01187152
Views:
19
>How can I delete and take out the data in my table.dbf? I have this code and it only marked the data to be deleted, but did not remove it. What am I missing?
>
>Please help.
>
>Thanks,
>Sam
>
>
>DELETE FROM testdata ;
>WHERE testdata.serialnum = m.lcSerialNum AND ;
>	testdata.testdatewrk = m.ldDateWrk
>
Deleted records stay in the table until you issue the PACK command. You should NOT do the PACK every time you delete, for the following reasons:
  • This is slow, and therefore inefficient - especially for large tables.
  • This will not work in multi-user environments, since you need exclusive access to the table.

    Instead, you should SET DELETED ON to hide deleted records. Do the PACK approximately once a month, when nobody is using the database.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform