Vlad, thanks for the response. It took some time before I could work this case again and I'm made progress but I'm still puzzled.
I found out that Teradata (in my case) waits at the end of the loop until the previous steps are finished. It does not wait within the loop until de query execution is finished and than resume the loop (what I expected).
So the actual time I recorded was the evaluation time for query before execution. My solution was simple, add a other time stamp after the loop completely finished and deduced other moments to get the right values. I expected the procedure to process synchronous, for real time it done asynchronous processing; it did not wait at the step I expected.
Vlad, thanks for the response. It took some time before I could work this case again and I'm made progress but I'm still puzzled.
I found out that Teradata (in my case) waits at the end of the loop until the previous steps are finished. It does not wait within the loop until de query execution is finished and than resume the loop (what I expected).
So the actual time I recorded was the evaluation time for query before execution. My solution was simple, add a other time stamp after the loop completely finished and deduced other moments to get the right values.
I expected the procedure to process synchronous, for real time it done asynchronous processing; it did not wait at the step I expected.