Can cursor variables be stored in PL/SQL tables.If yes how. If not why?

No, a cursor variable points a row which cannot be stored in a two-dimensional PL/SQL table.

Showing Answers 1 - 3 of 3 Answers

No you can not store the cursor variable into pl/sql table

but yes the out put or cursor variable can be stored how:

set serveroutput on

declare
type v_table is table of emp%rowtype index by binary_integer;
my_table v_table;
i number;
cursor c1 is select * from emp;
begin
i := 1;
open c1;
loop
fetch c1 into my_table(i);
exit when c1%notfound;
i := i + 1;
end loop;
for r in 1.. my_table.count
loop
dbms_output.put_line(my_table(r).empno);
end loop;
end;

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions