Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select RECNO() puzzler
Message
De
14/08/1998 23:10:57
 
 
À
14/08/1998 22:11:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00126709
Message ID:
00127116
Vues:
26
>Craig,
>
>As you can see in the sample code, he *did* assign (sql) aliases. It does not seem unreasonable to assume that SQL would use the self-same alias as has been supplied, when one *has* been supplied.
>
>I know of the Help warning, but I have to doubt that *this* is the reason.
>
>Cheers,
>
>
>Jim N
>
>>>>You can use local aliases.
>>>> SELECT RECNO("Cust") AS CustRecNO, RECNO("Ord") AS OrdRecNo ;
>>>> FROM customer Cust, order Ord;
>>>> WHERE Cust.custid = "001" AND ;
>>>> Ord.orderid < "999"
>>>>Does that work for you?
>>>
>>>Charlie,
>>>
>>>Thanks for your reply.
>>>
>>>I have not been able to make it work. What is selected as the RECNO() in each case is the record in customer or order what was initially being pointed to when the SELECT command was issued. For instance, if the pointer in customer.dbf was at record 100 and the pointer in order was at record 50 when you issued the SELECT command as above, you would get two columns as follows:
>>>
>>>100 50
>>>100 50
>>>100 50
>>>100 50
>>>
>>>for as many records as were selected.
>>>
>>>I may not be doing it right, but my code seems to be like your example.
>>>
>>>regards,
>>
>>
>>This code will not work. SQL SELECT often does a USE AGAIN ALIS whatever on a table, so you never know what the alias of the Cust table will be.

He's trying to rely on the RECNO(), which isn't reliable in multitable joins....that is his problem.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform