I have a sample query like below in my procedure:
result_rec mypkg.mytype;
OPEN CUR1 FOR
select col1, col2, col3 from table1 where something = 'a'; --rows will always be 50
LOOP
FETCH CUR1
INTO myrectype;
EXIT WHEN CUR1%NOTFOUND;
result_rec.col1 := myrectype.col1;
result_rec.col2 := myrectype.col2;
result_rec.col3 := myrectype.col3;
PIPE ROW (result_rec);
END LOOP;
As you can see, every time I am looping 50 times. Is there a better way to do this? something like BULK COLLECT INTO? how would I implement that?