Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized view fails when parameter's table also in
Message
 
 
À
26/09/2002 18:30:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00705008
Message ID:
00705053
Vues:
11
This message has been marked as the solution to the initial question of the thread.
The reason you got all the records is because your JOIN criteria is the same as your filter [WHERE] criteria. If you changed to WHERE Fab.equip_id = ?nEquipID and store the value of the ID you want to the memvar nEquipID you would not need the alias.

>I have found a slightly obscure (at least to me) problem with parameterized views.
>
>I had a view :
>
>SELECT *,equip.eqno ;
> FROM fab LEFT OUTER JOIN equip;
> ON Fab.equip_id = Equip.equip_id ;
>WHERE Fab.equip_id = ?equip.equip_id
>
>The view fails showing all records not just those limited by the WHERE clause. No Error message.
>
>The join may be fouling the where clause.
>
>What I had to do was use a alias in either the join or the where clause.
>
>SELECT *,equip2.eqno ;
> FROM fab LEFT OUTER JOIN equip AS equip2;
> ON Fab.equip_id = Equip2.equip_id ;
>WHERE Fab.equip_id = ?equip.equip_id
>
>Only other time I used an alias in a join was when I had to use the same table with different join conditions.
>
>No question - just posted to get it into the database.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform