General information
Title:
Creating a remote view that joins 3 tables. Having trouble
I am using VFP 5.0 as my client and SYBASE SQL Anywhere 5.5.04 as my ODBC data source.
I have an Inventory file that has foreign keys to Department and Brand records. I want to have in my view the names associated with these foreign keys so that the name can be displayed easily.
This is my statement to create the remote view:
create sql view v_inventory remote connection prototype as ;
SELECT StockInventory.INV_ScanCode,Brands.BRD_Name,;
Departments.DPT_Name;
FROM dba.StockInventory StockInventory ;
LEFT OUTER JOIN dba.Departments Departments ;
ON StockInventory.INV_DPT_FK = Departments.DPT_PK ;
LEFT OUTER JOIN dba.Brands Brands ;
ON Brands.BRD_PK = StockInventory.INV_BRD_FK
VFP looks as though it has created the view, but if you attempt to modify the view you get the message "SQL: Cannot locate table". Then when viewing the view the third table in the SELECT is not there. It does not matter how I arrange the joins it is always missing the third table.
The SELECT statement part of this statement works fine if I run it through SYBASE ISQL.
I do have an ODBC trace of this. The one interesting thing that I notice right away is that there is not a SELECT statement for third table. There is a SELECT statement that matches the one sent then there are SELECT statements for StockInventory and Departments in this case.
If anyone has any suggestions they sure would be appreciated.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only