下面是编程之家 jb51.cc 通过网络收集整理的代码片段。
编程之家小编现在分享给大家,也给大家做个参考。
create or replace procedure pro_page(table_name in varchar2,page in number,line in number,in_where in varchar2,p_cursor out sys_refcursor) as --out 返回参数 --in 输入参数 --in out 返回参数 v_sql varchar2(200); v_where varchar2(200); begin ---判断条件 if length(in_where) = 0 or in_where is null then v_where := '1=1'; else v_where := in_where; end if; --获得sql语句 v_sql:='select * from( select t1.*,rownum num from '||t_name||' t1 where rownum<= ' ||(page*line)||' and '||v_where ||') where num >= ' || ((page-1)*line); --执行sql语句 open p_cursor for v_sql; end pro_page;
以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。