Answer Posted / hitendra yadav
Reference cursor is as like pointer in C ad PASCAL language
which is point the data's memory location,REF CURSOR is
dynamic cursor which can be open for more then one query.
there are two type of ref cursof:-
(1) WEEK REF CURSOR:- ref cursor which not have return
cluse in defination.
(2) STRONG REF CURSOR :- ref cursor which use return cluse
in defination.
for example:-
SET serveroutput ON
DECLAR
TYPE eref REF CURSOR; -- WEEK REF CURSOR
eref1 eref;
erec employees%ROWTYPE;
BEGIN
OPEN eref1 FOR SELECT *
FROM employees
WHERE dept_id=90;
LOOP
FETCH eref1
INTO erec;
DBMS_OUTPUT.PUT_LINE(erec.emp_id);
EXIT WHEN eref1%NOTFOUND;
END LOOP;
END;
| Is This Answer Correct ? | 30 Yes | 4 No |
Post New Answer View All Answers
Where can I learn sql for free?
Explain what is a column in a table?
What are different functions in sql?
Mention what are different methods to trace the pl/sql code?
How do you update a value in sql?
What are character functions in sql?
what is oracle database ? : Sql dba
How do you explain an index number?
What is view? Can we update view
What are the types of optimization?
Explain two easy sql optimizations.
what is the difference between $message and $$message? : Sql dba
what is the difference between cluster and non cluster index? : Sql dba
What are sql constraints?
What is a data manipulation language?