• <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        當(dāng)前位置:雨林木風(fēng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

        對于分頁辦法

        對于分頁辦法

        更新時間:2022-05-14 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

        時間關(guān)系,沒有經(jīng)過完全測試,這個是大概意思。
        CREATE PROCEDURE getnotes

           @forumID varchar(10),
           @a_intPageNo int ,
           @a_intPageSize int,
           @rootID varchar(10)
        AS  
             declare @m_intRecordNumber int
             declare @m_intStartRecord  int
             declare @pagecount int
             declare @temp int
             declare @end  int
             declare @sql varchar(500)
             declare @bbsname varchar(25)
             declare @articles int
             declare @manager varchar(30)
             declare @selectrootID varchar(500)
             declare @temprootID varchar(10)

             select @m_intRecordNumber = @a_intPageSize * @a_intPageNo
             select @m_intStartRecord = @a_intPageSize * (@a_intPageNo - 1) + 1

             set nocount on       
             select @bbsname=subjectname,@manager=manager,@articles=articles from bbs_subjects where subjectID=@forumID
             if @rootID='0'
                 begin
                 -- select @sql='declare m_curTemp Scroll cursor for select ID,title,shrink,rootID,orderID,pubtime,hits,bytes,username,email from bbs_forum_'+@forumID+'  WHERE rootID in (select distinct rootID from bbs_forum_'+@forumID+' ) order by rootID desc,orderID asc'     
                    select @sql='declare m_curTemp Scroll cursor for select rootID from bbs_forum_'+@forumID+' where rootID=parentID order by rootID desc'     
                end
             else
                  select @sql='declare m_curTemp Scroll cursor for select ID,title,shrink,rootID,orderID,pubtime,hits,bytes,username,email from bbs_forum_'+@forumID+' where rootID='+@rootID+' order by orderID asc'     
             
             exec(@sql)
             open m_curTemp

               set @pagecount = case
                    when  @@cursor_rows % @a_intPageSize=0 then @@cursor_rows / @a_intPageSize
                    when  @@cursor_rows % @a_intPageSize<>0 then @@cursor_rows / @a_intPageSize+1
               end
               if  @@cursor_rows<@a_intPageSize and @@cursor_rows>0
                  begin
                     select @pagecount=1
                  end
              

           if @rootID='0'
             begin
                 set @temp = 1
                 set @selectrootID='0'
                fetch absolute @m_intStartRecord from m_curTemp into @temprootID
                while  @@fetch_status = 0 and @temp < @a_intPageSize
                     begin
                           set @temp = @temp + 1
                           select @selectrootID=@selectrootID+','+@temprootID
                           fetch next from m_curTemp into @temprootID                   
                     end
                 CLOSE m_curTemp
                 DEALLOCATE m_curTemp
                 set nocount off
                 select 'pagecount' = @pagecount
                 select 'bbsname'=@bbsname
                 select 'manager'=@manager
                 select 'articles'=@articles
                 select @sql='declare curTemp Scroll cursor for select ID,title,shrink,rootID,orderID,Images,pubtime,hits,bytes,username,email  from  bbs_forum_'+@forumID+' where rootID in ('+@selectrootID+') order by rootID desc,orderID asc'
                 exec(@sql)
                 open curTemp
                 fetch first from curTemp
                 while  @@fetch_status = 0
                     begin
                           fetch next from curTemp
                     end
                 CLOSE curTemp
                 DEALLOCATE curTemp
               end
            else
                begin
                    set @temp = 1     
                    set nocount off
                    fetch absolute @m_intStartRecord from m_curTemp
                    while  @@fetch_status = 0 and @temp < @a_intPageSize
                    begin
                           set @temp = @temp + 1
                           fetch next from m_curTemp
                    end
                    CLOSE m_curTemp
                    DEALLOCATE m_curTemp
                end

        溫馨提示:喜歡本站的話,請收藏一下本站!

        本類教程下載

        系統(tǒng)下載排行

        主站蜘蛛池模板: 久久久免费观成人影院| 亚洲一区二区无码偷拍| 国产免费久久久久久无码| 亚洲成a人片在线观看老师| 亚洲精品色在线网站| 免费人成在线观看播放国产| 亚洲爆乳大丰满无码专区| 午夜一级毛片免费视频| 国产一区二区三区亚洲综合 | 国产曰批免费视频播放免费s| 亚洲美女免费视频| 黄色成人免费网站| 亚洲人成网亚洲欧洲无码| 国产男女猛烈无遮挡免费视频网站 | 永久免费av无码不卡在线观看| 亚洲欧洲国产精品香蕉网| 免费无码作爱视频| 中文字幕亚洲第一在线| 91九色精品国产免费| 亚洲jizzjizz少妇| 亚洲精品无码久久久久去q| 无码少妇精品一区二区免费动态| 亚洲国产精品久久久久婷婷老年| 中文字幕无码成人免费视频| 亚洲丁香婷婷综合久久| 国产AⅤ无码专区亚洲AV| 亚洲免费视频观看| 日本系列1页亚洲系列| 国产亚洲人成网站在线观看不卡| 91免费国产精品| 丰满亚洲大尺度无码无码专线| 亚洲午夜久久久久久久久久| 1000部拍拍拍18勿入免费视频软件 | 亚洲日本在线播放| 国产精品免费一级在线观看| 免费大片黄在线观看| 亚洲AV第一页国产精品| 在线观看免费宅男视频| 二区久久国产乱子伦免费精品| 亚洲国产高清视频在线观看| 亚洲精品tv久久久久久久久久|