dbTalk Databases Forums  

RAISERROR Usage

comp.databases.sybase comp.databases.sybase


Discuss RAISERROR Usage in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert Nurse
 
Posts: n/a

Default RAISERROR Usage - 01-19-2004 , 08:42 PM






Hi All,

I don't recall exactly how RAISERROR works. Does this command halt
the stored procedure and return to the caller automatically or is a
hard return necessary?

Thanks

Reply With Quote
  #2  
Old   
Michael Peppler
 
Posts: n/a

Default Re: RAISERROR Usage - 01-20-2004 , 10:05 AM






On Mon, 19 Jan 2004 18:42:55 -0800, Robert Nurse wrote:

Quote:
Hi All,

I don't recall exactly how RAISERROR works. Does this command halt the
stored procedure and return to the caller automatically or is a hard
return necessary?
A raiserror will not halt the proc - it behaves like a print statement
with an error code.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler (AT) peppler (DOT) org http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html



Reply With Quote
  #3  
Old   
Robert Nurse
 
Posts: n/a

Default Re: RAISERROR Usage - 01-21-2004 , 01:55 PM



So, since @@error is set with the value used with RAISERROR, can I
assume that RAISERROR sets the SQLState and NativeErrorCode with the
error value and string used with it?

Reply With Quote
  #4  
Old   
Ed Avis
 
Posts: n/a

Default Re: RAISERROR Usage - 01-22-2004 , 02:00 PM



rnurse (AT) cudbytech (DOT) net (Robert Nurse) writes:

Quote:
I don't recall exactly how RAISERROR works. Does this command halt
the stored procedure and return to the caller automatically or is a
hard return necessary?
Raiseerror is like a 'warn' call. I normally raiserror and then
return straight afterwards (using the convention that a negative exit
status from the proc means failure, and the exit status is zero minus
the raiserror number).

--
Ed Avis <ed (AT) membled (DOT) com>


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.