Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-Join view problems...
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00450013
Message ID:
00450039
Views:
19
>Morning everyone,
>
>I'm trying to create a view that brings together data from 8 different tables in my database, using the view editor everything went smoothly until I tried to browse or modify the saved view, at which point I would receive a "SQL: Column 'TEN99BOXID' is not found." error, yet if I browse it again, it works??
>

Couple of things- firstly, it's advisable that queries (or views) that join multiple tables using the JOIN syntax lay the SQ like:

FROM Table1 INNER JOIN Table2 ON Table1.Key=Table2.Key ;
INNER JOIN Table3 ON Table1.Key=Table3.Key ;

Instead of:

FROM Table1 INNER JOIN Table2 INNER JOIN Table3
ON Table1.Key=Table3.Key ;
ON Table1.Key=Table2.Key


The latter is the way that the view designer constructs SQL, and is one of the (many) reasons that the view designer should on;y be used for the simplest of views. Among others are its willingness to manipulate certain vital view properties and hack apart your SQL without asking.

VFP Views are a great techonology, but if you decide to use them you should get into the habit of constructing them by hand via CREATE SQL VIEW, and setting the advanced properties via DBSETPROP(), and avoiding the view designer except when performing simple operations on simple views.

You should also have a look at EView, available here in the files section, which is a functional replacement for the view designer that doesn't suffer from all the quirks of the native view designer, and has several other really helpful features for working with views.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform