create or replace package mytest is type T_CURSOR is REF CURSOR; -- Public function and procedure declarations
FUNCTION GetMSG( id IN NUMBER ) RETURN T_CURSOR;执行 SELECT mytest.GetMSG( 2485 ) FROM dual 后,取出的是ref cursor。但我想把ref cursor中的内容取出来?用select能实现吗?
FUNCTION GetMSG( id IN NUMBER ) RETURN T_CURSOR;执行 SELECT mytest.GetMSG( 2485 ) FROM dual 后,取出的是ref cursor。但我想把ref cursor中的内容取出来?用select能实现吗?
----------------------------------------------------------------
--参数类型为OUT的存储过程
----------------------------------------------------------------
cursor c is select * from t_employee t where t.depart_id='001';begin
/**
*用循环把查出来的数据拼接起来
*/
for c_result in c loop
result := result||c_result.e_name;
end loop; dbms_output.put_line('result='||result);
/**
*异常处理
*/
exception
when others then
dbms_output.put_line('there is no data !!');
end test_inout;这个是我在公司培训时做的一个过程示例,你可以利用一下,不知道对你的问题理解的对不对。
谢谢诸位的回答。