1、定入包
create or replace package cursorPkg as
type cursorType is ref cursor ;
end ;
2、定入存储过程,OUT类型为cursorType 
CREATE or replace PROCEDURE ReturnCursor
( tabname varchar2,thecursor OUT cursorPkg.cursorType ) as
 begin
 open thecursor for 
 SELECT * FROM tabname; 
 end;
/
3、在外部使用此游标