Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to TOUCH a DBF without changing data?
Message
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01178674
Message ID:
01178793
Views:
18
This is what I ended up doing. The table in question is a derivative table. Actually one of several. These tables provide analytics/metrics to a web app. They are regenerated at specific intervals many times per day. If certain parent tables haven't changed since last time the derivative tables were generated, then the derivative tables don't need to be regenerated. That saves lots of CPU cycles and disk i/o. However, the timestamp on at least one derivative table needs to be updated to the last time the generator ran, even if the table(s) weren't regenerated. This timestamp update is so the web app can tell the user when the analytics were last performed. By the way, this all runs in a VFP COM DLL that is invoked by an ASP page that is invoked automatically by a scheduler.
  USE (cTrackDataPath+ "BlahTable") IN 0 EXCLUSIVE 
  SELECT BlahTable
  IF RECCOUNT()>0     && Touch it
    GOTO 1
    DELETE
    RECALL
  ELSE 
    ZAP 
  ENDIF
  USE
This approach always seems to correctly update the timestamp to current date/time on the server without changing the data. Zap works on a zero-record file. There are synchro objects in the web app that keep other threads from trying to access BlahTable while it's being updated.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform