Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed issue: Set Relation .vs. Set Filter .vs. Select &
Message
From
21/10/1997 20:06:15
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
19/10/1997 21:29:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00055022
Message ID:
00055911
Views:
35
>>The fact you had no problems with it is just a happening (ie: you were >lucky!). Generally, is not good to use RECNO() inside a SELECT SQL. To use >it with a parameter: You base your program on your luck and cross your >fingers! :) >> >>Vlad > >You say there would be trouble EVEN when the alias is specified? > >That would imply that SQL chooses, at its whim, to ignore *parts* of >specifications. >Truly, I must doubt that. The trouble begins only when your SQL is done FROM two or more sources. You can only dream of what it does while it selects, so if you really want to have record number stored somewhere, this is the safe approach (at least that's what I use and I've not noticed any problems for years): select *, recno() as rcn from first_table into cursor first_cu select .... from first_cu, other_table, where ... etc Of course, any When clause which could limit the number of records retrieved in the first select is more than welcome, because it will copy all the records with all the fields plus an extra field, so it better not do it with _all_ the records. This approach may seem like an overkill, but it's safe. I've just tried the thing with the recno("alias") - you get what you ask for, really. Too bad it doesn't accept local alias (the one you give it within the SQL Select statement - that'd be fine, and at least be more reliably parsable... if "reliably parsable" exists ;)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform