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
What is denormalization in a database?
Why stored procedure is better than query?
What is a boolean in sql?
What is data manipulation language?
explain normalization concept? : Sql dba
how can we repair a mysql table? : Sql dba
how to use myisamchk to check or repair myisam tables? : Sql dba
How do I run a sql script?
How can you save or place your msg in a table?
What does fetching a cursor do?
Can you skip header records while loading? : aql loader
what is the difference between delete and truncate commands? : Sql dba
How to look at the current sql*plus system settings?
what is the difference between a local and a global temporary table? : Sql dba
Can we commit in trigger?