Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate field names in SPT
Message
From
19/09/2003 09:16:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
19/09/2003 09:09:23
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00830629
Message ID:
00830632
Views:
18
>Hello
>If the result of a SQL-SELECT query in VFP DBF has duplicate field names, Visual Foxpro adds "_A" to the first duplicate field and "_B" to the second.
>
>If the query is run in SQL server via Sqlexec, the first field returns with the name unchanged, and the second with a "1" appended.
>
>Is there any way to control this, that is, to get the same behavior? I have tons of reports that expect "_A" in field names.
>
>Thanks!

Explicitly name your fields. ie:

select * from customer inner join orders on customer.cust_id = orders.cust_id

would name cust_id as cust_id_a and cust_id_b.
select cs.cust_id as 'cust_id_1', o.cust_id as 'custID' ;
 from customer cs ;
 inner join orders o ;
 on customer.cust_id = orders.cust_id
Explicitly names fields to cust_id_1 and CustID and works with both VFP and SQL server.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform