1.首先要创建一个包
Code
create or replace package listdata is
type MyCURSOR is REF CURSOR;
PROCEDURE GetList(wherestr Varchar2, o_cDataSet Out MyCURSOR);
end listdata;
2.编写包体,并且编写存储过程
Code
create or replace package body listdata is
PROCEDURE GetList(wherestr Varchar2, o_cDataSet Out MyCURSOR) is
t_vSql varchar2(1000);
begin
t_vSql := 'select * from log ' || wherestr;
Open o_cDataSet for t_vSql;
end;
end listdata;
这样就完成了,可以和sqlserver返回的数据集一样了