Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Are views right for me (or what am i doing wrong)
Message
De
08/01/2004 09:35:53
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00865024
Message ID:
00865040
Vues:
18
>Could you give more details?
>1. What should the view do? How would the result look like?

The view should create a temporary table (cursor) linking all fields from all tables (excepting the keys). The result when have the same number of records as table 1, with the appropriate fields from the other tables.

>2. Should it will be updateable or just for browsing only?

Both.

>3. What is exactly the SQL statement for the view?

The SQL generated by the view designer is
select Parts.*, PartType.TypeDescription, CD.CDDescription, Location.LocName;
  from Parts left join PartType ;
    left join CD ;
    left join Location ;
    on Parts.Location = Location.Location;
    on Parts.CD = CD.CD;
    on Parts.PartType = PartType.PartType
This appears to nest the joins, so that the joins on location & cd are done just the once (ie all the resultant fields are the same) but join on part type works correctly (field match the keys from the 2 tables).

Hilmar gave an example of the SQL I would have expected to be generated (I haven't checked it works yet)

Thanks for taking the time to answer
Irene
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform