create or replace package pkg_const as
type REF_CURSOR is ref cursor;
end pkg_const;create or replace procedure SBGL_SELECT(
in_deptno in number,
out_curemp out pkg_const.ref_cursor
) is
begin
open out_curemp for
select * from sbgl_base where fid=in_deptno;
end SBGL_SELECT;上面这个存储过程在PL/SQL中调用怎么写?我右键TEST没有问题。
type REF_CURSOR is ref cursor;
end pkg_const;create or replace procedure SBGL_SELECT(
in_deptno in number,
out_curemp out pkg_const.ref_cursor
) is
begin
open out_curemp for
select * from sbgl_base where fid=in_deptno;
end SBGL_SELECT;上面这个存储过程在PL/SQL中调用怎么写?我右键TEST没有问题。
emptab pkg_const.ref_cursor;
emprow sbgl_base%rowtype;
begin
sbgl_select(10,emptab);
loop
FETCH emptab INTO emprow;
EXIT WHEN emptab%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('Name = ' || emprow.ename);
end loop;
end;
/