--在线状态检查器
--数据库Sybase的存储过程代码实现
--修改用户在线状态
--chinayaosir
CREATE PROCEDURE user_status(
@user_code char(10),
@password char(6),
@logtype char(1),
@result char(1) output
)
AS
BEGIN
select @result='1'
if @logtype='0'
begin /*login*/
if not exists(
select *
from b_coordinator
/*tablockx*/
where
(user_code=upper(@user_code))
and (password=@password)
and (statusflag<>'1')
)
begin
/*error user name*/
select @result='1'
raiserror 35007
end
else
begin
update b_coordinator
set statusflag='1'
where
(user_code=upper(@user_code))
and (password=@password)
select @result='0'/*success*/
end
end
else
begin /*logout*/
update b_coordinator
set statusflag='0'
where
(user_code=upper(@user_code))
and (password=@password)
select @result='0'/*success*/
end
END
数据更新-存储过程-SYBASE
最新推荐文章于 2021-04-08 13:59:19 发布