Sybase:是否可以设置@@error [英] Sybase: is it possible to set @@error

查看:31
本文介绍了Sybase:是否可以设置@@error的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Sybase 中设置全局变量 @@error = 0 以在 raiserror 语句后成功返回?

Is it possible in Sybase to set global variable @@error = 0 for successfull return after raiserror statement?

raiserror 'Test';
set @@error = 0;

推荐答案

在 Sybase ASE 中,您不能直接设置 @@error 或使用带有字符串的 raiseerror.

In Sybase ASE you can't directly set @@error or use raiseerror with a string.

使用 sp_addmessage 将自定义错误编号和消息添加到您的数据库.列出错误后,您可以使用 raiserror error_#

Use sp_addmessage to add custom error numbers and messages to your database. Once the error is listed, you can then reference it using the raiserror error_#

Sybase ASE 保留 20,000 及以下的错误号供系统使用,因此用户定义的错误可以从 20,001 开始

Sybase ASE reserves error numbers 20,000 and below for system use, so user defined errors can start at 20,001

有关 raiserror 可以在文档中找到.

More detailed information on raiserror can be found in the documentation.

这篇关于Sybase:是否可以设置@@error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆