Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET RELATION - please clarify
Message
From
01/05/2002 16:29:10
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
01/05/2002 12:59:08
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00651423
Message ID:
00651579
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>assuming that cust_id in the SET RELATION command refers to
>ORDERS.cust_id, how does VFP know what field from the parent table
>to use in the relation ? does the parent table field HAVE to
>have exactly the same name as the child relation field (or index) ?

>if the parent field name is "customer_id" and the child field (or index?)
>name is "cust_id" ... how would i write the SET RELATION command ?
>if for some reason i couldn't rename the field, would i have to
>copy the parent table to another (temporary) table and change the
>name ?

I use relations where the parent key and the child key are quite different. In one pair of tables (one of which I inherited) the key is numeric in the parent and character in the child. Both key fields have different names. My code looks like
SET ORDER TO Provider IN Providers
SELECT PedDemog
SET RELATION TO VAL(DistCode) INTO Providers && DistCode is C(4)
I've also used part of a key field. One table had an index on PatientID + DTOS(VisitDate) DESCENDING like "AB123420020501" and with NEAR ON you could SEEK the PatientID and come to the most recent visit.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform