|
-
Hi,
You can declare local variables or a record type.
create or replace package pk1 as
type t1 is ref cursor;
procedure p1( x out t1);
type r is record
(
vn_empno emp.empno%type,
vs_ename emp.ename%type,
vn_sal emp.sal%type
);
end pk1;
/
create or replace package body pk1 as
procedure p1 (x out t1) as
begin
open x for select empno,ename,sal from emp;
end p1;
end pk1;
declare
type s is ref cursor;
c s;
r1 pk1.r;
begin
pk1.p1(c);
loop
fetch c into r1;
exit when c%NOTFOUND;
dbms_output.put_line( r1.vs_ename||' '||r1.vn_sal||' '||r1.vn_empno);
end loop;
end;
Cheers
Slash
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|