儲存過程
create procedure dbo.select_my
@num varchar(20),
@user varchar(40),
@pagenum int,
@countt int output
asset nocount on
if @user is null
select @countt=count(id) from [招聘資訊]
else
select @countt=count(id) from [招聘資訊] where 招聘職位 like '%'+cast(@user as varchar(40))+'%'
--@countt=cast(@countt as int)
declare @str nvarchar(4000)
if @user is null
set @str='select top '+ cast(@pagenum as varchar(20))+' * from [招聘資訊] where (id not in (select top '+ cast(@num as varchar(20))+ ' id from [招聘資訊] order by id desc)) order by id desc'
else
set @str='select top '+ cast(@pagenum as varchar(20))+' * from [招聘資訊] where 招聘職位 like ''%'+ cast(@user as varchar(40))+'%'' and (id not in (select top '+ cast(@num as varchar(20))+ ' id from [招聘資訊] where 招聘職位 like ''%'+cast(@user as varchar(40))+'%'' order by id desc)) order by id desc'
print @str
exec sp_executesql @str
-- if @@rowcount>0
-- return @@rowcount
-- else
-- return 0
go22.asp
<%textfield=trim(request("textfield"))
%>
<%
while not rs.eof
%>
<%=rs(0)%>
"><%=rs(1)%>
<%
rs.movenext
wend
%>
<%
for i=0 to (dd/pagenum)
if cint(page)<>i then
response.write(" ")
response.write((i+1))
response.write("")
else
response.write(" "&(i+1)&"
")end if
next
%>
<%
rs.close
set rs=nothing
mycomm.parameters.delete 3
mycomm.parameters.delete 2
mycomm.parameters.delete 1
mycomm.parameters.delete 0
set mycomm=nothing
myconstr.close
set myconstr=nothing
'response.write(username)
%>
自己寫的通用分頁儲存過程
新手一個,寫的最簡單的儲存過程分頁,上 吧,還請大神們多多調教!1 use bms 2go 3 object storedprocedure dbo pages script date 12 21 2015 11 48 57 4 set ansi nulls on5go 6set quoted id...
帶排序的oracle分頁儲存過程
create or replace package pager istype curs is ref cursor procedure pagination inpagesize in integer,每頁記錄數 inpageindex in integer,當前頁數 intablename in ...
帶排序的oracle分頁儲存過程
輸入order by 的sqeuence是,應該為 desc 或者 asc 若輸入兩個order by則,v order field a sequence order by b create or replace procedure tablepage select v page size int,...
自己寫的垃圾分頁
1.分頁的css 使用bootstrap的css 下面是html 2.構建分頁需要個引數 當前頁 總頁數 function loadhouselistpage cur page,total page else 判斷是否顯示 if cur page 1 else 分頁是 4 1 4 的這種結果的,當頁...
自己寫的oracle儲存過程會用到
create or replace procedure prc statistic declare table name varchar2 table name pass varchar2 not exist varchar2,not exist record varchar2 eg t stati...