Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SET RELATION - please clarify
Message
De
01/05/2002 12:59:08
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SET RELATION - please clarify
Divers
Thread ID:
00651423
Message ID:
00651423
Vues:
43
...a really basic, dummy kind of question...

in the famous SET RELATION documentation example, the parent
table is CUSTOMERS and the child table is ORDERS.
the documentation does not actually say both tables have a field
called cust_id.

now, if i understand correctly, to set a relation between the
two, you do something like this:
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 ?

if (as the documentation says) the child table has to be indexed on
the field that you want to 'relation' on, why do you need to specify
the child field (if that's what field is being referred to in the
SET RELATION command).

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 ?
patrick
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform