2006 Nov 22 7:23 AM
Hi Friends,
I am using loop inside loop giving timing out so in this case how i will avoid loop inside loop since the inner loop also having so many records. I heard that some parallel cursor concept but i dont know about that .
Can you please suggest how to avoind nested loop with some example
Points will be award and your answers are highly appreciable
Thanks & Regards,
Govind
2006 Nov 22 7:25 AM
Hi Friends,
I am using loop inside loop giving timing out so in this case how i will avoid loop inside loop since the inner loop also having so many records. I heard that some parallel cursor concept but i dont know about that .
Can you please suggest how to avoind nested loop with some example
Points will be award and your answers are highly appreciable
Thanks & Regards,
Govind
2006 Nov 22 7:25 AM
2006 Nov 22 7:40 AM
2006 Nov 22 9:07 AM
Hi Govind!
There is also a nice weblog <a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops">'Performance of Nested Loops'</a> with coding example from Rob. Have a look. The nested loop itself isn't the problem, you just should use binary search or an internal table of type 'sorted'.
Regards,
Christian
2006 Nov 22 9:35 AM
Instead of using loop inside loop,
use loop and read statement.
if both the tables have some common key then use the keyoption else use the index and increment the index after readind.
count = 0.
loop at ITAB1.
read table ITAB2 with key or
read table ITAB2 INDEX count.
count = count + 1.
endloop.
2006 Nov 23 6:28 AM
Hi all,
I solved my problem and awarded the points also
Regards,
Govind
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |