Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to clear out the contents of a View
Message
From
21/01/2005 09:27:21
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
20/01/2005 16:57:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00978872
Message ID:
00979243
Views:
16
Hi Colin

Is there a product ID or something unique in each record? If so, index the view on that unique ID. You could use that index to update the view with data from the csv. Select the matching records from the CSV, update the view. Then select the unmatching records from the csv, append them into the view. You might even want to delete records from the view that are not in the csv. Then after all of that issue a single tableupdate.

That should result in the table matching the csv. If you need to reduce the number of updates, you could check if something in the csv is different from the view.

select * from csv where csv.ID = view.ID and (csv.price <> view.price OR csv.description <> view.description)

HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform