Oracle下建立存储过程中调用另一个带参数的存储过程
这个存储过程已经建立好
CREATE OR REPLACE PROCEDURE GetThingsList_s(p_begin IN NVARCHAR2, --时间范围
p_end IN NVARCHAR2, --时间范围
p_type IN NVARCHAR2, --类型
p_source IN NVARCHAR2, --来源
p_streetID IN NVARCHAR2, --街道
p_communityID IN NVARCHAR2, --社区
p_gridID IN NVARCHAR2, --网格
p_pageSize IN INTEGER, -- 单页显示的记录数
p_pageIndex IN INTEGER, -- 当前页码
p_numRecord OUT INTEGER, -- 所有符合查询条件的总记录数
p_result OUT SYS_REFCURSOR -- 查询结果集返回值游标
) AS
v_pageLowerBound INTEGER;
v_pageUpperBound INTEGER;
BEGIN
v_pageLowerBound := (p_pageIndex - 1) * p_pageSize + 1;
v_pageUpperBound := p_pageIndex * p_pageSize;
SELECT COUNT(*) INTO p_numRecord FROM (select 100 from dual) M;
OPEN p_result FOR
select *
from (
SELECT sysdate, ROWNUM AS rn
FROM dual
WHERE ROWNUM <= v_pageUpperBound
)
WHERE rn >= v_pageLowerBound;
END;
create or replace procedure GET_s_tblcase_s(
p_ID in NVARCHAR2,--登录人ID
p_result OUT SYS_REFCURSOR --返回结果
)as
BEGIN
OPEN p_result FOR
select * from tblCase T,S_CaseSession S where(T.Controluser= p_ID OR S.Userid=p_ID )and T.CID=S.Csid;
这里写调用GetThingsList_s存储过程
end;