Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More on saving a multi-table view
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
More on saving a multi-table view
Divers
Thread ID:
00213524
Message ID:
00213524
Vues:
67
here is some more info to further explain my problem. the original question is at the bottom.

even though my view has data from two tables i am only trying to update one of the tables. the reason that i have used two tables to create the view is because i want the user to see the character code equivalent of the FK which is an integer.

both of my tables have PK's in the structure, but i did not include the PK from both tables in the create view statement.

in the example select statement below, TABLE1 is the child table (the one i want to update). the FK from TABLE1 relates to the PK of TABLE2.

what i am trying to do in the grid is edit the field that was derived from TABLE2 because it is a code that the user picks from a combo box control. based on the combo box code selected, i want to update update the TABLE1.FK column in the combo box valid event.

original question...

i have a view that combines data from two vfp tables.

the tables are related through a foreign key and the fk's are
used as the inner join condition between the tables. here is
how my code looks...

create sql view MYVIEW ;
as select ;
TABLE1.PK , ;
TABLE1.FK , ;
TABLE1.COLUMN1 , ;
TABLE1.COLUMN2 , ;
TABLE1.COLUMN3 , ;
TABLE2.COLUMN1 , ;
from TABLE1 ;
inner join TABLE2 ;
on TABLE1.FK = TABLE2.PK

i displayed the rows from the view in a grid.

i can edit TABLE1.COLUMN2, TABLE1.COLUMN2, TABLE1.COLUMN3 and
successfully update the base table. when i edit TABLE2.COLUMN1 the
tableupdate fails.

i have tried different combinations of dbsetprop and cursorsetprop
calls to set the tables and fields that can be updated but i have not
had any luck.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform