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
How do you declare a constant?
Can variables be used in sql statements?
explain normalization concept? : Sql dba
What is aggregate function in sql?
List the different type of joins?
How would you convert date into julian date format?
What information is needed to connect sql*plus an oracle server?
Is sql a backend language?
What does the file extension accdb stand for?
Can we use distinct and group by together?
How can you load multi line records? : aql loader
what are the advantages and disadvantages of cascading style sheets? : Sql dba
Why commit is not used in triggers?
What is lookup table in sql?
Is not equal in sql?