Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Relationship Problems
Message
De
22/09/1999 10:31:20
Lawrence De Grano
Computer Craft Corporation
Makati, Philippines
 
 
À
22/09/1999 10:12:13
Jolene Dicks
Human Resources Development Canada
St. John's, Terre-Neuve, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00267561
Message ID:
00267571
Vues:
21
>I am trying to set up a relationship between two tables in order to do one replace statement by a particular field. The same code never seems to work twice, not the same way anyway...
>
>Below is the code that I am testing...
>
>Use Gidetail && This is my child table
>Set order to sessionkey && Common field
>
>Select sessionkey from gisum;
> where Upld_stat = 1 into ;
> table o:\Tmp && Tmp will be my parent table
>
>Set Relation to Tmp.sessionkey into Gidetail
>
>Replace all Gidetail.dnld_stat with 1 for;
> Gidetail.sessionkey = Tmp.Sessionkey
>
>
>What I would like to accomplish is to establish a list of records (from the Gisum table), from which I can replace the dnld_stat with 1 for in the Gidetail table.
>
>The relationship is fine when I check it. I browse both tables and as I click on a sessionkey in the Tmp (parent) table, only those sessionkey records display in the gidetail (child) table. However, the replace statement doesn't work. I have played around with the = condition (just reversing - Tmp.Sessionkey = Gidetail.sessionkey). It will only mark the first of multiple sessionkey records. Either that or sometimes, it will mark all the sessionkey records for the current sessionkey in the Tmp (parent) table.
>
>I have always had trouble with this code. Other times, I have done it competely backwards and it works. For instance, in reference to the code that I have above, I have indexed the tmp table once it has been created and basically made tmp the child and gidetail the parent. It worked!!! In other instances.... But not this time.
>
>If anyone has any suggestions, please let me know.
>
>Thanks!!!!
>
>
>Jolene Dicks


Hi Jolene. The problem with relationships, I think, is that you cannot loop on the child table. I think it would be better to set the relationship off first before executing your 'replace' command or better if you'll have another table on the dataenvironment or you can also use a different alias and use that for your replacements.
Inzo
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform