![]() |
|
||||||||||||||
| | 网站首页 | 数据库教程 | web编程 | 服务器 | 程序设计 | | ||
|
||
|
|||||
| sybase存储过程问题 | |||||
作者:佚名 文章来源:不详 点击数: 更新时间:2007-6-30 ![]() |
|||||
|
问: SYBASE存储过程,为什么执行到这一句就不执行了
select @nSerialNo = serialno from schedule where phonenum= @strPhoneNum and type = @nType if @@rowcount = 0 begin ... end else begin ... end 上面的select结果是空记录集,存储过程一执行到空记录集,就会返回? 答:if exists(select @nSerialNo = serialno from schedule where phonenum= @strPhoneNum and type = @nType)这个语句的逻辑有点问题? if exists 一般是用来确定是否存在类似的记录?你现在又要将存在的结果赋值?其实还不如写 if exists(select 1 from schedule where phonenum= @strPhoneNum and type = @nType) 确定是否存在这样的记录,在执行相应的处理。
|
|||||
| 文章录入:admin 责任编辑:admin | |||||
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 | |||||
| 最新热点 | 最新推荐 | 相关文章 | ||
| 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
| | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 网站地图 | 管理登录 | | |||
|