sql> create or replace package types 2 as 3 type cursortype is ref cursor; 4 end; 5 /
程序包已創(chuàng)建。
2、函數(shù)sql> create or replace function sp_listemp return types.cursortype 2 as 3 l_cursor types.cursortype; 4 begin 5 open l_cursor for select id, title from cf_news order by id;--表的名字 6 return l_cursor; 7 end; 8 /
函數(shù)已創(chuàng)建。
3、過(guò)程
sql> create or replace procedure getemps( p_cursor in out types.cursortype ) 2 as 3 begin 4 open p_cursor for select id, title from cf_news order by id;--表的名字 5 end; 6 /