Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating Tables from Views
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Updating Tables from Views
Divers
Thread ID:
00955579
Message ID:
00955579
Vues:
53
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
Fil
Voir

Click here to load this message in the networking platform