General information
Category:
Coding, syntax & commands
Title:
Relationship Problems
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only