Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select with additional conditions
Message
De
16/11/2007 17:38:25
 
 
À
16/11/2007 17:32:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01268865
Message ID:
01269573
Vues:
13
>>>>>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 && now in workarea A
>>>
>>>SELECT ... ;
>>>  FROM AnotherTable A ;
>>>  ...
>>>
>>>
>>>VFP would get confused over what A meant.
>>
>>Well, my understanding is that the *idea* behind the SQL engine has been complete isolation, for a very long time. For example, the warnings about using UDFs in SQL commands (in VFP9 help, "Considerations for SQL Select Statements") have been there for a long time (i.e. in a lot of earlier versions).
>>
>>During development and testing I've occasionally seen weird errors using single-letter aliases, but for me it's always been caused by a violation of the rules set forth in the Help section referenced above.
>>
>>I suppose there could be a *bug* in one or more VFP version(s) that might make it act up as you describe. I have some heavily-used VFP apps that do some serious data munging in VFP5, using single-letter aliases and I've never had a reported problem. I'd be interested in knowing if anyone else has run into any problems, or has some repro code that shows any such problem in VFP5 or later.
>
>I used to know how to reproduce this one, but it's been several versions since they fixed it. There definitely was such a bug at one time in the VFP era.

I happen to own HackFox 3, and on page 652 you & Ted give the same warning. Maybe Ted remembers, or maybe it was specific to VFP3? (which I don't consider a "real" version of VFP, anyways :))
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform