Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is UNION acceptable in a View?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00485727
Message ID:
00486472
Vues:
13
If the UNION is not a UNION ALL, a single record in the result could represent records in both source tables. If the record is changed in the view, does it do the same update in both tables, or what?

>Hi!
>
>You're not correct. Any view and SPT cursor could be made updatable. There are 5 properties of cursor you can set to organize any king of update for any cursor. The query used to make cursor does not matters. Well, you cannot do this from the view designer, but definitely you can do this using CursorSetProp() and DBSetProp() functions.
>
>>>>It's legal to use UNIONs in a view, as long as it's defined with CREATE SQL VIEW and you don't later attempt to modify it with the VFP View Designer.
>>>>
>>>>However...
>>>>
>>>>Is it good practice to use UNION clause(s) in a view? Or, is that usually a sign that the database should be refactored?
>>>
>>>I think using UNION may be a (good) sign that the database is successuflly normalized. Usually views are used to denormalize data for particular uses, such as querying or reporting.
>>
>>Since a cursor from a UNION query will not be updateable, is there any reason to use a view rather than just a cursor? Might it add unnecessary overhead?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform