Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select RECNO() puzzler
Message
From
16/08/1998 06:01:35
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
14/08/1998 16:16:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00126709
Message ID:
00127191
Views:
35
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform