Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniqueness of index PRIMARY is violated
Message
From
12/10/1998 09:03:48
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144393
Message ID:
00145875
Views:
42
>>IMO, SQL fields should be aliased one way or another because there's no sane way to format or tidy them, and this only if it's a join.
>
>Could you elaborate? I don't need to alias fields in a join...

You don't - your fields are prefixed. That's one for you. In regular (ummm) case, when same field in two tables has the same name, if you say

Select i.*, c.* from invoice i, customer c where c.custcode=i.custcode

the resulting cursor will have fields like custcode_a and custcode_b, because it will include equal field names twice and name them like this to aviod ambiguity. It usually narrows down to picking fewer fields, like

Select i.*, c.custTitle, c.custAddress, c.custPhone;
from invoice i, customer c where c.custcode=i.custcode

So you do have a point here - this is the case where prefixing has some real advantages for us lazy programmers :).

>One other (slight) advantage to using prefixes (that occurred to me as I read another thread) is that there's no danger of using a reserved word as a field name.

I think I wrote that :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform