Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY TO command ????
Message
 
À
03/09/2004 15:31:44
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00939296
Message ID:
00939315
Vues:
11
COPY ;
 FIELDS childtable1.field1,childtable1.field2 ;
 for parenttable.field=condition; 
 TO (cFile) TYPE XL5
>How do I export the matching records of the child tables ONLY after a FILTER has been issued in the main parent table.???
>
>
>I have 1 parent table and 7 related tables:
>-------------------------------------------
>LABORATORY Index * ID (parent)
>
>LAB_MECHANICAL Index cLab_ID (child)
>LAB_PHYSICAL Index cLab_ID (child)
>LAB_VISUAL Index cLab_ID (child)
>LAB_RUNNING Index cLab_ID (child)
>LAB_COMP Index cLab_ID (child)
>LAB_TREATMENT Index cLab_ID (child)
>LAB_RUNNING Index cLab_ID (child)
>
>ONE-TO-ONE relationship with LABORATORY. The above are RELATED to the LABORATORY table: cLab_ID fields of child tables matche ID field of LABORATORY parent table.
>
>Upon a search (SELECT - SQL) I set a FILTER of the LABORATORY records that match the criteria after the search is performed :
>
>Search (SELECT):
>---------------
>
>SELECT LABORATORY.ID FROM LABORATORY WHERE ...ORDER BY LABORATORY.ID INTO CURSOR crsSearchResults
>
>Filter:
>-------
>
>INDEX ON ID TO crs_IDX
>SET RELATION TO ID INTO crsSearchResults IN LABORATORY
>SET FILTER TO NOT EMPTY(crsSearchResults.ID) IN LABORATORY
>
>Copy:
>-----
>
>SELECT LABORATORY
>COPY TO (cFile) TYPE XL5
>
>My question is: How do I export the matching records of the child tables ONLY ??? ... Child tables that have clab_id that match the ID of only the filtered records of Laboratory!
>
>Thanks in advance!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform