Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to properly set up 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:
00542603
Message ID:
00543129
Vues:
25
You meant create on view that joins all five tables right?

>Create one view that joins both tables and includes the needed fields from both tables. You could parameterize the view by adding a filter on Order Number [for example]. The filter would be something like WHERE OrderNum = ?nOrderNum
>
>WHen you open the view, you either add the NODATA clause or already have the variable [parameter] defined -- nOrderNum = 1234
>
>Then , when the OrderNum changes all you do is:
>
>nOrderNum = 1235
>requery('MyView')
>
>
>>I need to use a view with a lot of tables. For various reason but mostly
>>because relations are needed to be displayed in a grid, which at least in
>>vfp5 doesn't work well. I'll simplify for my example.
>>
>>parent child
>>---------------------
>>Order orderdet
>>orderdet prodcode
>>orderdet prodname
>>orderdet prodtype
>>
>>Here's what I have done...
>>
>>View1 -> order
>>view2 -> orderdet, prodcode, prodname, prodtype
>>
>>Then view1 relates to view2.
>>
>>But I'm wondering if the view should be...
>>
>>view1 -> order, orderdet, prodcode, prodname, prodtype
>>
>>...and do away with the relation.
>>
>>I will be appending records to the view and updating the tables.
>>
>>Which is the better way to do it?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform