请用过程实现Oracle数据的分页 
我谢谢大家了,有分一定散。恩人啊!!!

解决方案 »

  1.   

    函数实现的 
    CREATE OR REPLACE FUNCTION corpstaff_select
    (
              stater in number,
              endnum in number,
              s_corpid in varchar2
    )return SYS_REFCURSOR
    as
    --返回游标
      corpstaff_ref SYS_REFCURSOR;
     BEGIN
      open corpstaff_ref for
    select
                a.rowmm,
        a.CorpPersId,
                  a.PersId,
                  a.CorpCertNo,
                  a.WorkBegiDate,
                  a.WorkEndDate,
                  a.Duty,
                  a.TraiPersType,
                  a.InpuTime,
                  a.InpuBy,
                  a.Flag,
                  a.re,              a.PersType,
                  a.ValiType,
                  a.Name,
                  a.Alias,
                  a.Sex,
                  a.Nationality,
                  a.Birth,
                  a.Degree,
                  a.RegiCode,
                  a.RegiAddr,
                  a.Address,
                  a.TempAddr,
                  a.CertType,
                  a.CertNo,
                  a.IDNo,
                  a.PoliNo,
                  a.PursCode,
                  a.TelePhone,
                  a.Mobile,
                  a.CorpId
    from
    (
    select rownum as rowmm,
                  p.CorpPersId,
                  p.PersId,
                  p.CorpCertNo,
                  p.WorkBegiDate,
                  p.WorkEndDate,
                  p.Duty,
                  p.TraiPersType,
                  p.InpuTime,
                  p.InpuBy,
                  p.Flag,
                  p.Re,              s.PersType,
                  s.ValiType,
                  s.Name,
                  s.Alias,
                  s.Sex,
                  s.Nationality,
                  s.Birth,
                  s.Degree,
                  s.RegiCode,
                  s.RegiAddr,
                  s.Address,
                  s.TempAddr,
                  s.CertType,
                  s.CertNo,
                  s.IDNo,
                  s.PoliNo,
                  s.PursCode,
                  s.TelePhone,
                  s.Mobile,
                  s.CorpId
    from
    sic_ci_corporation_staff p,sic_ci_person s
    where
                   p.workenddate is null
              and
                 p.persid=s.persid
               and
                  s.valitype='0'
                and
                   p.corppersid like  s_corpid
                and
    rownum <= endnum
    order by p.persid desc
    ) a
    where
    a.rowmm >= stater
                    order by a.rowmm desc;                return corpstaff_ref;
        end corpstaff_select;
      

  2.   

    2楼的哥们
    那你返回的游标怎么在JAVA里面接受啊?
    不管怎样谢谢你
    我是初学
    有的地方还不是很明白啊
      

  3.   


    ResultSet
    来限定 条数。。实现假分页。。
    如果要实现真分页就用到
    select top 当前页的条数 from 表;实力代码多没法贴。。
    呜呜
      

  4.   

    参考下
    http://topic.csdn.net/u/20090523/16/7748F4E3-0C49-405C-9F1E-111E03F50D5C.htmlhttp://topic.csdn.net/u/20090504/12/8b09a374-c70e-4c7b-9522-3250d8b1a120.html