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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / narendrareddy

Generally, through static cursors we are using only one select statement at a time for single active set area. Whereas, in ref cursor we are executing number of select statements dynamically for single active set area. That’s why these types of cursors are called dynamic cursors.

1) Strong Ref Cursor: Having return type.
2) Weak Ref Cursor: Does not have return type.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / rahul

1) It's a datatype.
2) variable created based on this is called cursor variable
3) advantage is their capability to pass result sets between
programs

Is This Answer Correct ?    2 Yes 1 No

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

Answer / a.jyothsna

Difference between cursor and ref-cursors is same as the
difference between variable and constant.
With ref-cursors we can use the cursors variable.

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More SQL PLSQL Interview Questions

HOW TO APPEAR FOR ONLINE EXAMS OF SQL & PL/SQL? WHICH BOOKS WILL BE BETTER FOR REFERENCE TO QUALIFY THESE EXAMS? ARE THERE ANY MODEL PAPERS AVAILABLE IN THE MARKET ABOUT SQL & PLSQL?

2 Answers  


why we go for package? what are the advantages of using instead of seperate procuderes or functions

3 Answers   IBM, TCS,


if we give update table_name set column_name= default. what will happen? its given in pl sql block.what will hapen?

5 Answers   iFlex,


Explain select statements in sql?

0 Answers  


What is difference between inner join and cross join?

0 Answers  






What does the argument [or replace] do?

0 Answers  


Why join is faster than subquery?

0 Answers  


what is meant by nl2br()? : Sql dba

0 Answers  


What is Referential Integrity?

3 Answers  


How many subqueries can be nested in a statement?

0 Answers  


How we get all_group_function's(Sum,avg,count,max and min_value of a column(Sal) Using pl/sql anonymous block, with out using group function's. You shouldn't use more than one select statement in entire the program. Like cursor c is select * from <table_name>; except this you can't use another select statement. You can use no of variables as per requirement.

1 Answers  


Are stored procedures compiled?

0 Answers  


Categories