BUG: A SELECT-SQL error may occur when a parent table is joined to two child tables in Visual FoxPro (157254)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft Visual FoxPro for Windows 7.0
- Microsoft Visual FoxPro 8.0
- Microsoft Visual FoxPro 9.0 Professional Edition
This article was previously published under Q157254 SYMPTOMS
Using the SELECT-SQL command with the ON clause, to Join a Parent table to
two child tables, may cause the following error:
SQL: Column <column name> is not found
If the error occurs, then a result set is not created by the query.
CAUSE
The Visual FoxPro query parser looks at the SELECT-SQL queries starting
from the innermost part of it. In the case of the SELECT..JOIN..ON
statement in the MORE INFORMATION section of this article the parser looks
at the following:
INNER JOIN test3 ;
ON test1.t1f1 = test3.t3f1 ;
The parser cannot resolve the reference for "test1.t1f1" because it is not
in scope at this level.
WORKAROUND
You can use one of the following workarounds to correct this behavior:
- Run the Query after opening all the tables involved with the query. This
way the Visual FoxPro query parser is able to resolve all the
references.
- Modify the Query in the MORE INFORMATION section of this article as
follows:
SELECT *;
FROM test1;
INNER JOIN test2;
ON test1.t1f1 = test2.t2f1 ;
INNER JOIN test3 ;
ON test1.t1f1 = test3.t3f1
With the above query, the parser is able to relate each ON clause to the
JOIN clause that it belongs to.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article.
REFERENCES
For more information, please see the following article in the Microsoft
Knowledge Base:
156667 Limitations of View Designer vs. CREATE SQL VIEW Command
Modification Type: | Major | Last Reviewed: | 3/17/2005 |
---|
Keywords: | kbBug kbProgramming KB157254 |
---|
|