首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

oracle怎么返回结果集

2012-12-24 
oracle如何返回结果集?点击右边红色标题查看本文完整版:oracle如何返回结果集?oracle如何返回结果集?creat

oracle如何返回结果集?
点击右边红色标题查看本文完整版:oracle如何返回结果集?

oracle如何返回结果集

create or replace procedure test
(ResultCur Out Sys_Refcursor)
is

begin
open ResultCur for
SELECT * from module_tree;

end test;

初学 oracle,编译通过,但是测试的时候没有返回结果集,请教哪里出了问题!

------解决方法--------------------
CREATE OR REPLACE PROCEDURE Ll_02 (p_cursor OUT sys_refcursor) IS
BEGIN
OPEN p_cursor FOR
SELECT * FROM B_AREAS;
END Ll_02;
-------------------------

DECLARE
P_CURSOR sys_refcursor;
v_row B_AREAS%ROWTYPE;
BEGIN
-- P_CURSOR := NULL; Modify the code to initialize this parameter

ET_STATISTICS.Ll_02 ( P_CURSOR );
LOOP
FETCH p_cursor INTO v_row;

EXIT WHEN p_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(v_row.area_id);
END LOOP;

--COMMIT;
END;

--
O
E
S
M
W
N
H
?

    

热点排行