Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select with additional conditions
Message
From
15/11/2007 12:42:48
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01268865
Message ID:
01269204
Views:
11
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform