我的包装中有一个sp,看起来像这样
PROCEDURE SEARCH_SOMETHING (
InParam IN VARCHAR2,
InParam2 IN NUMBER,
OutCursor OUT empcur)
如何运行它并查看游标检索到的数据?
答案 0 :(得分:1)
您可以简单地在begin end块中调用光标。或使用Execute语句。
DECLARE
L_INPARAM VARCHAR2;
L_INPARAM2 NUMBER;
L_OUTPARAM empcur;
BEGIN
L_INPARAM:= value;
L_INPARAM2:= VALUE_NUMBER;
SEARCH_SOMETHING (
L_INPARAM,
L_INPARAM2
L_OUTPARAM);
for i in L_OUTPARAM
loop
use values of i;
END LOOP:
END;