Need the difference between strong Ref Cursor and weak Ref Cursor examples

Oracle 9.2

It would be great if someone can help understand the differences between
1 Strong Ref Cursors(return type)
and
2. weak Ref Cursor (no return type)

What I read is weak ref Cursor as sys_refcursor is better to use the ref Cursor, because in the case of slider strong Ref object type that will be returned must be declared in advance. It dosent make sense to me?

I start with the examples would be appreciate for advice

Strong Ref Cursor

create the package str_pack
is
type sref_type is ref cursor return emp % rowtype;
SVAR sref_type;
end str_pack;

Create procedure st_proc (eid in number, c1 on str_pack.sref_type)
is
Start
Open c1 to select empno, ename, sal from emp where empno = eid;
end;

declare
str_pack.sref_type C1;
type rec is RECORD (eid, ename varchar2 number (20), number of sal);
SheikYerbouti rec;
Start
st_proc(10,C1);
loop
When exit c1% notfound;
Fetch c1 into SheikYerbouti.
end loop;
Close c1;
end;


There could be errors in the above example but its basically to get a better understanding.

For weak Ref Cursor

procedure of the child

Create procedure child_proc (in number, c1 on sys_refcursor eid)
is
Start
Open c1 to select empno, ename, sal from emp where empno = eid;
end;

parent process

Create procedure parent_proc (recnum varchar2)
is
p_retcur sys_refcursor;
emp_row emp % rowtype;
Start
child_proc (eid, p_retcur);
loop
extract the p_retcur in emp_row;
dbms_output.put_line(emp_row.empno ||) e '|| emp_row. Ename | "wins". emp_row. SAL);
end loop;
end parent_proc;

Concerning
@

Hello

the fundamental difference is to do with the compiling and linking of runtime type that occurs.

The he should explain a lot more detail than I could ever!
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1640161160708

P;

Tags: Database

Similar Questions

Maybe you are looking for