Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Are views right for me (or what am i doing wrong)
Message
From
08/01/2004 09:35:53
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00865024
Message ID:
00865040
Views:
17
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform