thanx for your answer.
You are right, there are few ways that i can do the job.
But my problem is time. i need to repeat the action for some 200,000 records and at the moment it takes 80 hours.
My question is about performance and need to find out which methods runs faster.
If possible, can you share/explain some more details on excatly what you want do in action part.
However lookup and peek functions serves the similar function but used on different conditions:
lookup is a mapping or a translation function: You could for instance have a product ID and you want to translate that into a specific product attribute. In other words – you never expect more than one value for the specific product ID. If there are several possible values in the lookup table, the lookup function will just take the first one found.If you do expect several values for each of the input values, you should not use a lookup function to solve the problem.
Lookup ('ProductCategory', 'ProductID', ProductID, 'ProductTable')
in above, Lookup() function will return the value of the field ProductCategory (first parameter) in the table ProductTable (fourth parameter) from the record where the field ProductID (second parameter) has the same value as the field ProductID in the order data table (third parameter).
The Peek() function is similar to the Lookup() function, but instead of addressing the other table using a field value, the peek function needs a row number.
Peek ('ProductCategory', -1, 'ProductTable')
Although the Peek() function is a lookup function, its use for solving similar problems is limited since you need the row number to get the desired value, and this is rarely the case.
Hope it helps...
i know how the two methods work, i produce a key with RowNo() in my load and i can use it in a loop to fetch data record by record using "Lookup" or i can go over a loop from1 to NoOfRows('myTable').
my question is about performance. i need the fastest method that one can read data from a table in script.
no doubt QV needs to search and find records in both "Lookup" and "Peek". which runs faster?
Or is there any better method that can i do it faster?