>>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 ;)