SQL*Plus调用返回游标的存储过程

create or replace package test_p
as

type outList is ref cursor;

PROCEDURE get(taxpayerList out outList);

end test_p;
/
create or replace package body test_p
as
PROCEDURE get(taxpayerList out outList)
is
begin
OPEN taxpayerList
FOR
select * from rs_zc;

end get;

end test_p;
/

set serverout on;

variable x refcursor;

exec 过程名(:x);

print x;

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus