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;

posted @ 2015-04-13 09:19  只需要一个眼神  阅读(2956)  评论(0编辑  收藏  举报