Perhaps this problem has already been solved, but I will leave my contribution, as
Trevisolli commented in the post above to bring the X records in x lines, I thought of using Bulk Collect.
This way you can return multiple records in a single fetch, there is one however, this feature uses more memory, then it is important to check the size X of lines to bring by fetch.
follows a sample code that I did:
Select all
PROCEDURE TESTE AS
--
CURSOR curOrders is
select order_id,
order_date,
order_mode,
customer_id,
order_status,
order_total,
sales_rep_id,
promotion_id,
warehouse_id,
delivery_type,
cost_of_delivery,
wait_till_all_available,
delivery_address_id,
customer_class,
card_id,
invoice_address_id
from orders;
--
TYPE tblOrders is table of orders%ROWTYPE INDEX BY PLS_INTEGER;
clOrders tblOrders;
--
vLimit PLS_INTEGER := 4000;
--
BEGIN
--
open curOrders;
--
loop
--
fetch curOrders
bulk collect into clOrders
limit vLimit;
--
dbms_output.put_line(to_char(clOrders.count));
--
exit when clOrders.count < vLimit;
--
end loop;
--
close curOrders;
--
END TESTE;