Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select SQL is not consistant in adding prefixes?
Message
From
23/04/2001 16:28:16
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00498731
Message ID:
00498741
Views:
9
>I was doing SQL like select * from Table1 inner join table2 etc. Tables have the same fieldnames. Usually SQL renames field to field_a, field_b, etc. Some field names were 10 symbols long. SQL does something strange: in same cases it adds _a prefix and in some - adds 2 at the end? Does somebody see this behavior and have explanations? Moreover, how many fields can this free table contain? If I select 100 fields from Table1, 100 from Table2, 100 from Table3, etc., will it error and what error it would be?



Just a gotcha I'd like to point out: should you move your data to another backend, you can't assume the other backend will name the duplicate field name the same way VFP does. SQLServer, for example, doesn't follow VFP's example.

I think you should always name each of your fields. I know, it can be very long sometimes when you have lots of fields, but I think it might prevent a few problems along the way.

Besides, you can write a little PRG which will use AFIELDS to list all the fields in your current work area, so issue your initial SELECT - SQL, use that PRG to put the field list in the _CLIPTEXT, paste in your code and make the modifications you require.

Just my 2 cents...
Sylvain Demers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform