Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating Tables from Views
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Updating Tables from Views
Miscellaneous
Thread ID:
00955579
Message ID:
00955579
Views:
52
All tables in the below problem are “free” .
I created a view “var_vw” programmatically from an empty “Vtable”.
Then I populated the view “var_vw” with data from a number of data views “dat_vw”
All views were created programmatically. The var_vw contains a “date” field & can contain a variable number of “var_” fields…var0 – varX depending on the number of variables needed.
I used views so all calculations could take place in RAM per recommendations from UT members…works great!!!
I can populate the var_vw fine. Now I want to update the entire associated “Vtable” (all columns), which has an alias “vtbl”.
None of my attempts using “dbsetprop” have worked. One attempt to update only the “var0” field/column is below:

Set multilocks on
=cursorsetprop(“buffering”,5,”vtbl”)
SELECT vtbl
DBSETPROP("var_vw","VIEW","TABLES","vtbl")
DBSETPROP(“var_vw.var0”, “field”, “UPDATENAME”, “vtbl.var0”
DBSETPROP("var_vw.date","FIELD","KEYFIELD" ,.t.) DBSETPROP("var_vw.var0","FIELD","UPDATABLE",.t.)
DBSETPROP("var_vw","VIEW","SENDUPDATES",.t.)
=TABLEUPDATE(.t.)
How do you use the DBSETPROP() function to update an entire Free table from its associated View?

By the way, using the COPY TO ARRAY command from the View and then appending the Array to the Table works. But I would like to know how to use the DBSETPROP() function.
Reply
Map
View

Click here to load this message in the networking platform