Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET Relation
Message
From
24/05/2001 08:24:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/05/2001 08:22:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00510772
Message ID:
00510801
Views:
13
>>Hi,
>> I have 2 table that related with master and child relationship.
>>
>>Customer
>>Cust_ID, Cust_Name
>>
>>Sales
>>SalesNo, Cust_ID, Amount
>>
>>
>>Relation: (one to many relationship)
>> I would like to get Cust_Name once user browse Customer Sales record without LOCATE to customer table again using Cust_ID.
>> Any suggestions?
>>
>>Thank you
>
>John,
>A relation doesn't prevent you from browsing to other records while parent hasn't changed. IMHO in that case best way to get cust_name would be :
>
>
select cust_name from parenttable ;
>  where cust_id = ChildTable.cust_id ;
>  into array arrTempCustName
Cetin

Optionally you could also use customer table again with another alias and set a relation to it from child (reverse relation). Then you only need to say :
Customer2.Cust_name
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
Reply
Map
View

Click here to load this message in the networking platform