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
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
一直是 Executing....
但是 module_tree 里有9条数据
也是一直运行么别的存储过程运行就都是好的么
-------------------------------------------------------------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;
我把你的code copy 到 pl/sql 运行报错
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;
Encountered the symbol "DECLARE"
v_module_small module_tree.module_small%Type;
CURSOR result IS
SELECT module_small FROM module_tree WHERE module_big = strBig;
Test_Result result%ROWTYPE;
BEGIN
OPEN result ; loop
FETCH result INTO Test_Result ;
v_module_small:= Test_Result.module_small;
EXIT WHEN result%NOTFOUND ;
end loop;end TEST2;我改成这样为什么还是在Executing