日期:2014-05-17 浏览次数:20871 次
procedure getrows(
v_tablename varchar, --表名
stanum integer, --开始
endnum integer, --结束
x_cur out XCH_CURSOR --返回
)
as
v_sql varchar(200);
begin
v_sql:='select b.zgxm,c.dwmc,a.* from
(select b.* from (select a.*,rownum as rn from (select * from '|| v_tablename ||') a
where rownum<='|| endnum ||') b where rn>='|| stanum ||' ) a
left join h_grxx b on a.grzh=b.grzh
left join h_dwxx c on a.dwzh=c.dwzh' ;
open x_cur for v_sql;
end getrows;