>>>>>>Is that correct? I thought that SQL aliases have nothing to do with A-J aliases for work areas.
>>>>>>
>>>>>>>It's a bad idea to use one leter meaningless table aliases in a query. It makes the query totally unreadable. It also could be dangerous because letters A-J are reserved for workareas 1-10.
>>>>>
>>>>>From my testing, you are correct: Message#
1154483>>>>
>>>>It's no longer a problem, but at one time, you could get unexpected results with something along these lines:
>>>>
>>>>
>>>>SELECT 1
>>>>USE MyTable
>>>>
>>>>SELECT ... ;
>>>> FROM AnotherTable A ;
>>>> ...
>>>>
>>>>
>>>>VFP would get confused over what A meant.
>>>>
>>>>Tamar
>>>
>>>What was that time?
>>>In my experience, (V)FP was NEVER confused in the scenario above. Maybe the programmer, but that's always a possibility.
>>
>>My example may be too simple, but I definitely saw cases where the use of single letter aliases in queries caused a problem.
>>
>>Tamar
>
>I definitely saw them in the past with earlier versions of VFP. I simply stopped using single letter aliases in SQL statements a long time ago, so I couldn't tell you if it's still a problem or not. But it certainly did exist.
Fred and Tamar,
I'd really like to see a case when you assign a one letter alias in an SQL, and SQL gets "confused".
I have FPD/FPW/VFP5/VFP9 installed, so in case you no longer have them, I can test your scenarios.
I am NOT talking about coding mistakes, i.e. reference one letter aliases that were not assigned in the SQL statement. FWIW, if you reference an alias that is not assigned in the SQL the behavior changed from FPD/FPW to VFP5/9:
- In FPD/FPW you
get an error, regardless of having or not having a file open in that work area.
- In VFP5/9 you
don't get an error if there is a file open in the work area. So, yes, you could see this as a trap in which it is easier to fall with one letter aliases, but it is still a simple case of coding mistakes, not a mysterious behavior.
I am not advocating using one letter aliases here, just saying that SQL is not confused by them.
Doru