how a reference cursor works?what all adnvantages are
gained with it..specify the situation?

Answer Posted / swapnareddy

Basically, Reference cursor is datatype.Reference cursor works
as a cursor variable.the advantage of using reference cursor
is it pass the result sets to the subprograms
(ie,procedures,packages and functions etc).
example for reference cursor usage:
type r_cursor is ref cursor;
c_emp r_cursor;
ename1 emp.ename%type;
begin
open c_emp is select ename from emp;
loop
fetch c_emp into ename1;
exit when c_emp% notfound;
dbms_output.put_line(ename1);
end loop;
close c_emp;
end;

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are keys in sql?

546


What is a table?

565


a table has 2 classifications 1)liabilities 2)earnings this liabitity has 2 elements with 2 input values and the earnings have 2 elements with 2 input values i wrote a query so that my input is liability savings amount1 amount2 xxxx null xxxxxx 0 xxx1 null xxxxx1 0 null yyyy 0 yyyy null yyy1 0 yyy1 my problem is --when i developed a report(d2k) with this data my o/p is liabilities,amount1,savings,amount2 xxxx xxxxxx xxx1 xxxxx1 yyyy yyyy yyy1 yyy1 how could i move this savings,savings values 2 palces up. can any body provide me witha better solution

1774


How do I turn a list into a table?

504


What is the use of pl/sql table?

554






define data blocks ? : Sql dba

544


how to check server status with 'mysqladmin'? : Sql dba

566


what is a trigger? : Sql dba

573


Does truncate require commit?

541


What are the benefits of pl/sql packages?

541


How do you exit in sql?

587


What are local and global variables and their differences?

580


What does (*) mean in sql?

527


What is the difference between left and left outer join?

513


what is sub-query? : Transact sql

596