Sybase IQ中的 @@error @sqlstatus

春雨-rain 2010-09-08 10:26:48
请教一下高手:

   Sybase 中有好多系统的变量,比如上面的那俩个,我想问下,每个变量具体的取值表示什么意思呢?

  例如@error就有0--表示没有错误
  1


。。。。
这些数字又表示什么错误呢?
非常感谢!!
...全文
165 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
s46871 2010-09-10
  • 打赏
  • 举报
回复
The @@error global variable is commonly used to check the error status of the most recently executed batch in the current user session. @@error contains 0 if the last transaction succeeded; otherwise @@error contains the last error number generated by the system. A statement such as if @@error != 0 followed by return causes an exit on error.

Every Transact-SQL statement, including print statements and if tests, resets @@error, so the status check must immediately follow the batch whose success is in question.

s46871 2010-09-10
  • 打赏
  • 举报
回复
@@sqlstatus values Value
Meaning

0
The fetch statement completed successfully.

1
The fetch statement resulted in an error.

2
There is no more data in the result set. This warning occurs if the current cursor position is on the last row in the result set and the client submits a fetch command for that cursor.

  • 打赏
  • 举报
回复
看官方文档啊。

2,596

社区成员

发帖
与我相关
我的任务
社区描述
Sybase相关技术讨论区
社区管理员
  • Sybase社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧