Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update tables or views or both
Message
From
04/06/1998 14:27:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00104547
Message ID:
00104861
Views:
28
>Hi Sylvia,
>
>>I've created a parameterized view with two tables but wasn't sure whether to buffer the view, the underlying tables or both (or neither). My goal is to use views to see the underlying data, but then if I make a change to the view (and therefore the underlying data), want to see the updated info, etc.
>
>Only buffer the views. You specify how the view updates the base table in the view designer (key fields, updatable fields, Send SQL Updates, etc.)
>
>>In testing, if I buffer (optimistic table in all cases) one of the original tables and not the other, change values from both tables in the view and do a requery(), only the unbuffered table's data is refreshed in the view (even though in lookiing at the underlying table in the view, it seems to have been updated.
>>
>>If I buffered the view and one of the tables, again change values in the view in fields from each of the underlying tables, but only do a table update on the view and then requery(), neither underlying table is updated.
>
>Again, you should only buffer the views. I use Optimistic Table all the time and use TABLEUPDATE(0) to update the current record and TABLEUPDATE(1) to update all modified records (sometimes I use BEGIN/END TRANS with GETNEXTMODIFIED as well).
>>
>>This is all very confusing. Forsooth, can someone pray tell me whether 'tis nobler in the mind to buffer or not buffer (or to suffer the slings and arrows or outrageous data?
>
>I'll try and explain what's happening this way and hopefully this makes sense:
>
>Buffered View - 3 levels are present which are data in table, data in view, and data in views buffer. During add/modify you are working with the buffered data. TABLEUPDATE updates the view from the buffer and the table data is updated based on how you defined the view.
>
>Buffered View and Buffered Table - 4 levels are present which are data in table, data in tables buffer, data in view, and data in views buffer. During add/modify you are working with the buffered view data. TABLEUPDATE updates the view from the views buffer and the tables buffer data is updated based on how you defined the view. At this point the base table isn't updated.
>
>
>HTH

Thanks to everyone for your replies. I've been working more with this today and have a much better understanding now. I also got far enough to run into the same problem with trying to join 3 tables as I read about in another thread. Fortunately, I learned about this VD 'feature' before I spent too much time on it.

Sylvia
Previous
Reply
Map
View

Click here to load this message in the networking platform