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:48:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
08/01/2004 09:27:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00865024
Message ID:
00865045
Views:
23
>Hilmar,
>thanks for the reply - I understand the SQL you gave as an example & it is roughly what I expected (even down to the table/field names). The SQL that is automatically generated from the view that I created seems to nest the joins rather than do them sequentially -
>
>
>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;
>  into cursor TempReport
>
I am not sure whether this would be equivalent to the non-nested version.

>I wondered if I were missing something within the view designer - I've tried various options of join & adding AND/OR but none seemed to alter the nesting of the joins, which is where I thought the fault lay.

I think it is difficult to control this in the view designer.

>The documentation doesn't appear to give any examples of joining several tables to a single table, only examples of chaining 1 table to another in sequence (unless I've missed something).

First, you should consider whether you really want a view. If it is for a report, or any other R/O purpose, writing your query yourself (perhaps, after some initial help from the query designer) is more appropriate. You can even drastically reduce the time required for the query, at least in some cases, by splitting the query into pieces!

Second, views can be maintained programmatically, but it is more difficult to do so. Search the download section; I think there are some programs that can you help you there. IIRC, eview has been favorably commented in this discussion group. According to the author: "Utility for editing and maintaining views that are too complex for the view designer. Form based interface offers access to many features that the native view designer does not."

But first, decide whether you really need a view in the present case. For editing, I would just use one separate form for each table, and, where appropriate, use special objects that let the user select a record from the other table, and return the PK.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform