Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select RECNO() puzzler
Message
De
16/08/1998 06:01:35
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
14/08/1998 16:16:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00126709
Message ID:
00127191
Vues:
33
>>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"
>
>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

Of course it works that way. The others have posted the theory here, so I won't repeat it. Just a shorthand workaround:


SELECT *, RECNO() AS CustRecNO;
FROM customer Cust;
WHERE Cust.custid = "001" ;
INTO Cursor Tmp1

SELECT tmp1.*, < ord.somefield(s) >;
FROM Tmp1 Cust, order Ord;
WHERE Cust.custid = ord.custid AND ;
Ord.orderid < "999"

Now the final cursor will have the CustRecNo properly filled. Recno() in SQL select works on single table queries only.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform