Take the 2-minute tour ×

I need to loop through a large table contains around 20k of rows. I tried using CURSOR and BULK COLLECT but it still takes very long time, around half to complete.

What is an efficient way in PL/SQL to loop through the large data set.

share|improve this question
There is no other way if you have to use sql. Depending on task you might not need to use loop, this is the only way to improve performance. –  Piotr Auguscik Oct 14 '11 at 9:26
show us your code so far - this may provide an indication of where the bottleneck is occurring. –  toop Oct 14 '11 at 9:26

1 Answer 1

up vote 2 down vote accepted

normally looping through 20 k rows will be faster if you simply select them. The result can be manipulated while selecting, or you can manipulate the result in a temporary table or a table variable.

share|improve this answer
Thanks, I got an idea from your comments. Instead of looping i join it with the other table for data manipulation. :) –  Ianthe Oct 17 '11 at 8:56

Your Answer


