Oracle存储过程返回一张表数据

  在oracle数据库中你要在程序里得到一张表的数据就必须先创建游标和SQL Service不一样。

--创建游标
create or replace package pkg_Data
as
type refcursor is REF cursor;
procedure pro_rows(refcursor out refcursor);
end pkg_Data;

--创建存储过程
create or replace procedure prc_DataInput
(dateStr in varchar2,tableStr out pkg_data.refcursor)
is
begin
open tableStr for (select * from 表 where to_char(date,'yyyy-MM')=dateStr);
end prc_DataInput;

原文地址:https://www.cnblogs.com/changeMe/p/4421316.html