Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Skip record in child table
Message
De
10/11/2003 12:00:29
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
10/11/2003 05:53:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00848202
Message ID:
00848375
Vues:
15
>I have Form with Parent and Child table linked with Relation.
>When I do SKIP 1 for child table it moves to next record regardless of a relation with a parent table.
>I want to do SKIP in Child table only with records that are related to Parent table.
>How?

You want a one-to-many relationship, but the default of SET RELATIONS is one-to-one. Use the SET SKIP TO command in combination with the SET RELATION command to do what you want. For example, try the following program (assuming you've installed the sample data):
CLOSE DATABASES ALL
USE (HOME()+'SAMPLES\TASTRADE\DATA\Orders.DBF') IN 0
USE (HOME()+'SAMPLES\TASTRADE\DATA\OrdItems.DBF') IN 0 ORDER Order_ID
SELECT Orders
SET RELATION TO Order_ID INTO OrdItems
SET SKIP TO OrdItems
SCAN FOR Order_ID = "     2"
  ?OrdItems.Order_ID, OrdItems.Product_ID, OrdItems.Quantity
ENDSCAN
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform