Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET RELATION - please clarify
Message
From
01/05/2002 13:10:34
 
 
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:
00651431
Views:
25
This message has been marked as the solution to the initial question of the thread.
>...a really basic, dummy kind of question...

Not a dummy question at all, though it is a fundamental issue.

>
>SELECT ORDERS
>SET ORDER TO TAG cust_id   && tag name just happens to be same as field name?
>SELECT CUSTOMERS
>SET RELATION TO cust_id INTO ORDERS
>
>
>QUESTIONS:
>in the "SET RELATION to cust_id INTO ORDERS" command, is the cust_id
>referring to ORDERS.cust_id or to CUSTOMERS.cust_id or to the ORDERS index tag cust_id ?

Cust_id in the SET RELATION command refers to the Cust_Id field in Customers. In fact, you can use an expression, not just a field name, there.

What the command says, in essence is "Create a link between the table in the current work area and the named alias. Do it by setting up an automatic look-up of the expression in the SET RELATION command into the current index order of the named alias."

IOW, it's as if you did a SEEK in the specified table each time you move the record pointer. That's why the child table has to be indexed on the relevant tag.

>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 ?

You can probably answer this yourself now, but it would be:
SET RELATION TO customer_id INTO Orders
Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform