Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A SET RELATION question?
Message
De
04/10/2000 10:46:44
 
 
À
04/10/2000 10:35:03
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00424100
Message ID:
00424736
Vues:
16
>>>>Robert,
>>>>
>>>>SELECT Table1.*, Table2.* ;
>>>>    FROM Table1 FULL JOIN Table2 ON Table1.SomeKey = Table2.SomeKey ;
>>>>    ORDER BY SomeField
>>>>
>>>>
>>>>
>>>>>>If you used SQL with a FULL JOIN for your report you could check for NULLs in the parent part of the record.
>>>>>Hi Cindy and yes I see the value of built-in referential integrity.
>>>>>Could you send me a small sample of code of how to use SQL with a FULL JOIN.
>>>Thanks Cindy - Is this the same as a SET RELATION, but using a SELECT statement?
>>
>>No. Set relation will leave out orphan child records.
>>
>>The purpose of the FULL JOIN is to show NULL in the "parent" fields for an orphan child record, NULL in the "child" fields for a parent without children, and all fields filled in for parents with children.
>>
>>Also, set relation is done on the actual tables, the result of an SQL SELECT statement will result in a "copy" of the data - fine for a report but maybe not for data editing.
>
>Robert, what you should do to really understand this is to make yourself 2 cursors with 2 records apiece and do a SELECT with a FULL JOIN. The "parent" cursor should have one record that has no child and the "child" cursor should have one record that has no parent.
>
>You would get
>
>ParentField    ChildField
>-----------    ----------
>Data           .NULL.     && Parent with no child
>Data           Data       && Parent with matching child
>.NULL.         Data       && Orphan child
OK - I will do that and thanks for your help....you are the people that keep
the universalthread alive....:)
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform