Forum Discussion
I'm slightly confused what you're trying to do here?
You have two tables - one names, one address. The two have "MRN" as the common value linking the two?
So when you select a name in table 1, it's MRN will match an address in table 2? You want to find the row in table two that matches the MRN in table 1?
But you table lookups (which lookup and write to the log only right?) only appear to retrieve a value and write it to the log? They don't actually change the position of any cursor/pointer in the table? (I don't think, I'm not sure how or why you're using project variables for this?)
And your second loop will only ever run once?
You set a value (based on the first loop) and your loop says "do this loop while the values are equal".
But you set the values to equal before you run the second loop:
RecordIdx = AddressRecord
While RecordIdx = AddressRecordAnd then increment RecordIdx in the loop. So as soon as you increment it (which will be the first time in the loop) the condition is broken and the loop will exit. So you'll only ever check one row in the second table?
The lookups all appear to be hardcoded (in quotes) in the both loops as well? Should they not be using variables and comparisons?
What kind of table is it? If you're asking what method of the table (or underlying data set - depends on the table type) you use to move the cursor/pointer within the table, we need to know what kind of table it is ....
I'm confused ....
The table type is a TestComplete Table Variable. One table, the parent, has patient information in it and the second table, the child, has address information that is associated to the patient table. There can be 1 to many address information so I need to be able to iterate through these values or the particular MRN of the Patient. The MRN field is the PK, FK relationship between them. I have this set up in a KeyWord test. The Patient table has a data-driven loop around it. I'm doing a while loop around the Address table. I have a variable set up that has the current MRN number of the Patient table. The while loop is set up to go through the Address table while it's MRN is equal to the MRN variable that is set to the one currently in the Patient table. There is no problem with incrementing through the loops. Where I have the issue is that if I start the Patient table out where the MRN = 3 (which you can do with the data-driven loop, is start at any record number you want), the while loop for the Address table doesn't do anything because the current MRN is 1, not 3. I want to start the Address table at the same MRN as the Patient table. Basically like in a sql query, Select * from Address where MRN = 3 and then do a while loop around it so that it will go through till the MRN doesn't equal 3. Does that make sense? Since I'm dealing with the Table Variable I'm not sure how to get the cursor to start at a particular record in it.