Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

bulk collect problem

StarJun 21 2011 — edited Jun 21 2011
I have following annymous block.

Table imei_temp contains the 9 records with processed_flag = 'N';

If I execute following block with limit 10 I am not getting any result.
However, If I change value 10 to 3 I am getting all 9 records present in the imei_temp table

can anyone help to me so that I should get all the 9 rows even limit is 10

DECLARE
CURSOR c_load_imei_temp
IS
SELECT imei
FROM imei_temp
WHERE processed_flag = 'N';
TYPE load_imei_table IS TABLE OF c_load_imei_temp%ROWTYPE;
rloadtemp load_imei_table;
BEGIN
msgs('START');
OPEN c_load_imei_temp;
LOOP
FETCH c_load_imei_temp BULK COLLECT INTO rloadtemp LIMIT 10;
EXIT WHEN c_load_imei_temp%NOTFOUND;
FOR lv_index IN 1..rloadtemp.count
LOOP
msgs(rloadtemp(lv_index).imie);
END LOOP;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
MSGS(SQLERRM);
END;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2011
Added on Jun 21 2011
7 comments
100 views