Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select with additional conditions
Message
De
15/11/2007 12:42:48
 
 
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:
01269204
Vues:
12
>>I think using one-letter aliases is a matter of taste as far as readability goes. I use them all the time.
>
>Hi Al,
>
>I have no objections to one leter table aliases unless they are VFP reserved words. The 'one leter meaningless table aliases' are different story. Using them in a query is the same as using following proceduaral code (yes I've seen such code in real life)
>SELECT A
>USE mytable1
>SELECT B
>USE mytable2
>...
>* Somehwere later
>SELECT B     && At this point it's impossible to tell what table code is refering to w/o going back and finding USE command.
>
Are you sure ?
In recent VFP version this issue it is overtake.
CLOSE DATABASES ALL
CLOSE TABLES ALL
SELECT A && AS SELECT 1
WAIT WINDOW SELECT()
SELECT J && AS SELECT 10
WAIT WINDOW SELECT()

CREATE CURSOR W1 (F1 I)
INSERT INTO W1 VALUES (1)
CREATE CURSOR W2 (F1 I)
INSERT INTO W2 VALUES (2)
W2DBF=DBF()

* these are equals, uses SELECT(0)

SELECT F1,ALIAS(),SELECT(),DBF()==m.W2DBF FROM W2 ALONNAME

SELECT F1,ALIAS(),SELECT(),DBF()==m.W2DBF FROM W2 A

SELECT F1,ALIAS(),SELECT(),DBF()==m.W2DBF FROM W2 J

SELECT F1,ALIAS(),SELECT(),DBF()==m.W2DBF FROM W2 Z
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform