Information générale
Titre:
Updating Tables from Views
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.
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement