Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
10 types of people
Message
From
13/10/2003 15:49:33
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00836301
Message ID:
00838285
Views:
38
>>>>>>>The letter A was used in a sql-select. Let me PINS (reverse of SNIP) it here once more:
>>>>>>>
select distinct ttod( a.from ) from ( lcFile ) a into array laTmp
>>>>>>>Tamar was referring to this usage. For the sake of the eventual discussion, let's limit the debate to whether or not it's 'allowed' (according to the idea of 'superb standards') in sql-select statements. The arguments you both gave against usage are not valid for usage in sql-selects, IMO.
>>>>>>
>>>>>>This is exactly the usage that can get you in trouble. If you have a table already open in workarea 1, there can be confusion as to what a. refers to in the query.
>>>>>
>>>>>No confusion possible ... simply because you can see the A being declared in the sql-select statement.
>>>>
>>>>But if you already have a table open in workarea 1 (which is also workarea A), then there's confusion between that workarea and the one in the query.
>>>>
>>>>Tamar
>>>
>>>Tamar;
>>>
>>>That would be a fun problem to track down. Work areas 1-10 and the A-J issues can be avoided.
>>>
>>>I will only use a unique name for an alias. I have seen too many people get bit by the use of A-J aliases and I also consider such usage too cryptic. Additionally, I have had to solve problems where a developer used an alias name more than once from different data sources.
>>>
>>>I have worked with VB programmers who use one letter aliases. That combined with the use of “Me” references seems self centered! I had better stop before I offend someones "standards"! :)
>>>
>>>Tom
>>
>>Tamar/Tom,
>>
>>We're going in circles <s>. The A is only used during the creation of the final cursor. Regard what's happening during the creation as happening in a private datasession. Only the endresult is important to the rest of the code/environment.
>>Let me repeat that there's no confusion possible. There's almost always some table open in area 1/A. Every programmer knows (should know) that there's no relation whatsoever between the table in that area and the 'inner-alias' A as declared in the sql-select.
>>It must be a matter of mindset and selective perception here. Your thoughts when seeing an A-alias in a sql-select must be a matter of personal bias.
>>
>>It's not me who's wrong here! Not this time :).
>
>I agree with Tamar on this one. I have seen the SELECT get confused and cause extremely difficult to track down bugs in the past. Whether this is still a problem with SELECT or has been fixed, I do not know. I've simply made it my own personal rule to use at least 2 character SELECT alias' as this prevents all possible confusion with the A-J, 1-10 standard areas.

Hi Fred,

I have never seen the sql-select get confused (I'm in fp/vfp since 1990 or so) and I'm also certain that I'll never gonna see it happen in the future. It's just simply not true that VFP can get confused. There's only one way to convince me in this case and that is some 'code to reproduce'.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform