This Domain(Admin5.com) is for Sale:

数据库存储过程---实践

时间:2007-12-23  来源:不详  作者:迈克DB

FETCH NEXT FROM cur_crzhsd INTO @cr_id, @zh_id, @cnt, @sym, @time_stamp
END
CLOSE cur_crzhsd
DEALLOCATE cur_crzhsd
SELECT * FROM #temp_proc3
DROP TABLE #temp_proc3

织梦内容管理系统


drop procedure fgw_proc3
EXEC fgw_proc3 1, 1111111111

4,fgw_proc4

CREATE PROCEDURE fgw_proc4(@zh_id int , @level char(30) , @time_stamp int , @cnt int OUTPUT , @isOK int OUTPUT)
AS

织梦内容管理系统

SET NOCOUNT ON
SET @isOK = 0
DECLARE cur_zh CURSOR FOR SELECT to_cnt,time_stamp FROM AHD.AHD.ztr_his WHERE id = @zh_id and to_status in ('L1WIP','L2WIP') and time_stamp>@time_stamp
OPEN cur_zh
DECLARE @time_stamp1 int
SET @time_stamp1=0
FETCH cur_zh INTO @cnt, @time_stamp1
IF @time_stamp1!=0
BEGIN
IF CHARINDEX('一级', @level) IS NOT NULL AND CHARINDEX('一级', @level)!=0
BEGIN
if @time_stamp1 - @time_stamp <600
SET @isOK=1
END
ELSE IF CHARINDEX('二级', @level) IS NOT NULL AND CHARINDEX('二级', @level)!=0
BEGIN
if @time_stamp1 - @time_stamp <1800
SET @isOK=1
END
ELSE IF CHARINDEX('三级', @level) IS NOT NULL AND CHARINDEX('三级', @level)!=0
BEGIN
if @time_stamp1 - @time_stamp <1800
SET @isOK=1
END
ELSE IF CHARINDEX('四级', @level) IS NOT NULL AND CHARINDEX('四级', @level)!=0
BEGIN
if @time_stamp1 - @time_stamp <1800
SET @isOK=1
END
END

dedecms.com

CLOSE cur_zh
DEALLOCATE cur_zh
--SELECT @isOK, @time_stamp1 copyright dedecms

dedecms.com

drop procedure fgw_proc4
exec fgw_proc4 1,'1',1,1,1

织梦内容管理系统

   asp">存储过程

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息