Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Frustration: Add same table twice in a view joined on 2
Message
De
22/04/2003 14:19:20
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00780110
Message ID:
00780260
Vues:
12
>Hi all
>
>I have a view lv_tInquiry. All fields updatable.
> Add Table mAccounts, Inner Join tInquiry.iPartyID = mAccounts.iID
>
>This in itself will work. Now...
>
>Again Add Table mAccounts, Inner Join tInquiry.iAgentID = mAccounts_a.iID
>
>This view though when modifying does not have any problem. But if you save it and want to reopen this view it wont open giving an error SQL: Column 'iAgentID' is not found.
>
>I tried opening this view in ViewEditor I get the same messge with error no. 1806. The following is the SQL generate for this view:
>
>SELECT TINQUIRY.*, ;
>		MACCOUNTS.CNAME, ;
>		MACCOUNTS.CCITY, ;
>		MACCOUNTS_A.CNAME, ;
>		MACCOUNTS_A.CCITY ;
>	FROM VSO3!TINQUIRY INNER ;
>		JOIN VSO3!MACCOUNTS INNER ;
>		JOIN VSO3!MACCOUNTS MACCOUNTS_A ;
>				ON TINQUIRY.IAGENTID = MACCOUNTS_A.IID ;
>				ON TINQUIRY.IPARTYID = MACCOUNTS.IID ;
>	ORDER BY TINQUIRY.DDT, TINQUIRY.CBK, TINQUIRY.INO
>
>
>I have tried Left Outer Join and same results. Right Outer Join and Full Join wont work in my case atleast.
>
>Please help. This is just the tip of the ice-burg where I want to call the same master table twice. I may also have to call, if not the same master, other master(s) in the view also.

My first bit of advice would have been 'Ensure the table being joined twice has two aliases', but the SQL appears to have that. So, I've only got two SWAGs left: Ensure that the fieldnames in the result set have unique names, and try rewriting the SQL in sequential order, it might make more sense.

Chris.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform