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

        當前位置:雨林木風下載站 > 技術開發教程 > 詳細頁面

        對于分頁辦法

        對于分頁辦法

        更新時間:2022-05-14 文章作者:未知 信息來源:網絡 閱讀次數:

        時間關系,沒有經過完全測試,這個是大概意思。
        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

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

        本類教程下載

        系統下載排行

        主站蜘蛛池模板: 亚洲小说图区综合在线| 亚洲av激情无码专区在线播放| 亚洲欧美日韩综合久久久久| 免费看成人AA片无码视频羞羞网| 亚洲欧洲日产国码在线观看| 五月婷婷综合免费| 精品亚洲AV无码一区二区三区| 搡女人免费视频大全| 亚洲欧好州第一的日产suv| 国产成人免费全部网站| 曰批全过程免费视频观看免费软件 | 免费观看无遮挡www的视频| 亚洲1234区乱码| 日本特黄特色aa大片免费| 男人j进女人p免费视频| 久久久久无码专区亚洲av| 日韩视频在线观看免费| 亚洲福利一区二区精品秒拍| 成在人线AV无码免费| 久久亚洲中文字幕无码| 亚洲一区精品无码| 精品无码人妻一区二区免费蜜桃 | 中文字幕亚洲精品| 亚洲免费综合色在线视频| 免费国产黄网站在线看| 亚洲精品无码午夜福利中文字幕| 午夜理伦剧场免费| 亚洲精品欧美综合四区| 中文字幕亚洲一区二区三区| 95老司机免费福利| 国产亚洲精品2021自在线| 亚洲国产AV无码专区亚洲AV| 国产h视频在线观看网站免费| 朝桐光亚洲专区在线中文字幕| 亚洲色婷婷综合久久| 无码国产精品一区二区免费| 免费观看又污又黄在线观看| 亚洲一区二区在线视频| 国产精品国产午夜免费福利看| 日本视频在线观看永久免费| 亚洲爆乳大丰满无码专区|