Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Relations question
Message
De
22/01/2001 14:16:50
 
 
À
22/01/2001 13:57:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00466812
Message ID:
00466831
Vues:
18
>Hello guys,
>
>I have this relation tables question
>
> I have 3 tables
> I set the relations within them
> table1 relate to table2 and table2 multi-relate(one to many) to table3
>
>How do I go by scanning table3 results only. (table3 is 2000 rows) every
>results is about 3-4 rows in table3,
>
>
> @-- relations have been already set
>
> sele table1
> scan
> sele table2
> scan
> sele table3
> do while not in relation (of table2) <-- do not know if this works
> do some process
> skip
> enddo
> sele table2
> endscan
> sele table1
>endscan
>
>thanks
>
>marcos oliva
>

Two possible ways ( I'm sure there are others ) to do this I can think of. One would be to use the SET SKIP command to set up a one-to-many relationship between table2 and table3 and iterate through table1. I believe properly set up realtions and SET SKIP should iterat through all related records in the child tables before changing records in the top-level table. But, honestly I have not tested this with your scenario or with the SCAN command. If you try this, please let me know if it works properly. If I get soem time, I will try it myself.

Second, un-relate the tables and write code to manually loop through the appropriate records in each table.

But there may be more straightforward methods than these.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform