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
Is coalesce faster than isnull?
What is procedure in pl sql?
Why do we need cursor in pl sql?
Is there a way to automate sql execution from the command-line, batch job or shell script?
what is isam? : Sql dba
What is the basic structure of an sql?
what is self-join? : Sql dba
what are null values? : Sql dba
What is mutating error in pl sql?
What is audit logout in sql profiler?
Can you select everything, but 1 or 2 fields, without writer's cramp?
how to enter numeric values as hex numbers? : Sql dba
What does trigger mean in psychology?
Is it possible to remove child records without removing master table records...the two having pk,fk relationship?
Explain the structure of pl/sql in brief.