Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update a table via a grouped view
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00364981
Message ID:
00365101
Vues:
18
Cool, and I do use surrogate [integer] keys in all tables.

>Forget the group by. It is irrelevent to the core issue of updating records. Question, what do you need to update a record. Answer, a key. If it is a primary key, you will update 1 and only 1 record. If it is a non-primary key, you will update any record that has that key value.
>
>The concept is no harder than that... That is why PK's are essential. Further, it demonstrates why surrogate keys are better than composite/non-surrogate keys...
>
>Cool????
>
>>No, I do not question that. Like I said, logically I know this should/will work and is a clever way of doing so. This is a personal hang-up I have about relying on a group by view and having it acutally update multiple records based on changes made to 1 record. This just seems squirrely to me and has nothing to do with anyone or any thing else.
>>
>>>Are you asking me if I would suggest one way of doing things, but in reality, do something else?? Of course not. Mark, you should know me better than that.
>>>
>>>Granted, I don't use views. However, if I did and I needed to accomplish this task, I would do it this way....
>>>
>>>That said, the suggestion I made is IMO, the correct way. You know, there is a reason why you can select multiple key fields for a table...
>>>
>>>FWIW, it works just fine...
>>>
>>>
>>>Just curious. Would you really do it this way? While logically I know this should work, I just don't think I could put enough faith in a view like this to use tableupdate and hope all the records in the group by get updated. Just me personally, if I need fields from a group of records updated with the same values, I would go with the UPDATE SQL command.
>>>>
>>>>>Make sure that all three fields are available in your view. Further, make sure that all three fields are checked as the key fields in the update tab of the view designer...
>>>>>
>>>>>HTH.....
>>>>>
>>>>>
>>>>>>I have a GROUPed view and when I update a field, I want the update to happen in all the related detail records. The uniqueness is a combination of 3 fields. I tried several combinations of keys, but I either get too many records updated or only one.
>>>>>>
>>>>>>Any help would be appreciated. Thanks
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform