Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Should "return" reset @@error?

3 posts in Product Futures Discussion Last posting was on 2007-01-30 23:23:14.0Z
Jason L. Froebe [TeamSybase] Posted on 2007-01-29 23:11:31.0Z
From: "Jason L. Froebe [TeamSybase]" <jason@froebe.net>
Organization: TeamSybase
User-Agent: Thunderbird 1.5.0.9 (X11/20070103)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.product_futures_discussion
Subject: Should "return" reset @@error?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: c-76-16-157-120.hsd1.il.comcast.net
X-Original-NNTP-Posting-Host: c-76-16-157-120.hsd1.il.comcast.net
Message-ID: <45be8d33$1@forums-1-dub>
Date: 29 Jan 2007 16:11:31 -0700
X-Trace: forums-1-dub 1170115891 76.16.157.120 (29 Jan 2007 16:11:31 -0700)
X-Original-Trace: 29 Jan 2007 16:11:31 -0700, c-76-16-157-120.hsd1.il.comcast.net
Lines: 23
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1911
Article PK: 97526

Normally this would be fine but if you write a stored procedure wrapper
for sp_password (or another ASE stored procedure), it is impossible to
trap the exact error message from within your wrapper stored procedure.
The problem is that @@error is being reset by the return() operation,
indicating that the return(), itself, resulted in no error.

I know this is the way it is now, but should it remain so? I mean,
should the execution of return() reset @@error if called in a stored
procedure?

more at http://froebe.net/blog/2007/01/should_return_reset_error.html

--
Jason L. Froebe

Help find a cure for breast cancer! Net proceeds benefit the Susan G.
Komen Breast Cancer Foundation and the National Philanthropic Trust.
Help by donating at http://www.the3day.org/chicago07/jfroebe - I'm
walking 60 miles in 3 days in August 2007. (The day I return from
TechWave is the first day of the Walk)

WebBlog http://jfroebe.livejournal.com
Tech log http://www.froebe.net/blog


Eugene Korolkov Posted on 2007-01-30 15:31:48.0Z
Message-ID: <45BF6F7F.2000807@davidsohn.com>
From: Eugene Korolkov <ekorolkov@davidsohn.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.ase.product_futures_discussion
To: "Jason L. Froebe [TeamSybase]" <jason@froebe.net>
Subject: Re: Should "return" reset @@error?
References: <45be8d33$1@forums-1-dub>
In-Reply-To: <45be8d33$1@forums-1-dub>
Content-Type: multipart/alternative; boundary="------------000800090501040001080806"
NNTP-Posting-Host: 63.119.133.13
X-Original-NNTP-Posting-Host: 63.119.133.13
Date: 30 Jan 2007 08:31:48 -0700
X-Trace: forums-1-dub 1170174708 63.119.133.13 (30 Jan 2007 08:31:48 -0700)
X-Original-Trace: 30 Jan 2007 08:31:48 -0700, 63.119.133.13
Lines: 88
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1912
Article PK: 97527

Jason,

What is interesting that 'return' itself without value will not reset @@error.
About all confusing  ASE behaviour  regarding  error handling there are 2 interesing articles,
though they related to MS SQL server most of the stuff applying to ASE either.
(at least I could not find anything  better ).

http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html

Regards,
Eugene   

Jason L. Froebe [TeamSybase] wrote:

Normally this would be fine but if you write a stored procedure wrapper for sp_password (or another ASE stored procedure), it is impossible to trap the exact error message from within your wrapper stored procedure.  The problem is that @@error is being reset by the return() operation, indicating that the return(), itself, resulted in no error.

I know this is the way it is now, but should it remain so?  I mean, should the execution of return() reset @@error if called in a stored procedure?

more at http://froebe.net/blog/2007/01/should_return_reset_error.html



Jason L. Froebe [TeamSybase] Posted on 2007-01-30 23:23:14.0Z
From: "Jason L. Froebe [TeamSybase]" <jason@froebe.net>
Organization: TeamSybase
User-Agent: Thunderbird 1.5.0.9 (X11/20070103)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.product_futures_discussion
Subject: Re: Should "return" reset @@error?
References: <45be8d33$1@forums-1-dub> <45BF6F7F.2000807@davidsohn.com>
In-Reply-To: <45BF6F7F.2000807@davidsohn.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: c-76-16-157-120.hsd1.il.comcast.net
X-Original-NNTP-Posting-Host: c-76-16-157-120.hsd1.il.comcast.net
Message-ID: <45bfe172$1@forums-1-dub>
Date: 30 Jan 2007 16:23:14 -0700
X-Trace: forums-1-dub 1170202994 76.16.157.120 (30 Jan 2007 16:23:14 -0700)
X-Original-Trace: 30 Jan 2007 16:23:14 -0700, c-76-16-157-120.hsd1.il.comcast.net
Lines: 30
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:1913
Article PK: 97525


Eugene Korolkov wrote:
> Jason,
>
> What is interesting that 'return' itself without value will not reset
> @@error.
> About all confusing ASE behaviour regarding error handling there are
> 2 interesing articles,
> though they related to MS SQL server most of the stuff applying to ASE
> either.
> (at least I could not find anything better ).
>
> http://www.sommarskog.se/error-handling-I.html
> http://www.sommarskog.se/error-handling-II.html
>
> Regards,
> Eugene
>

Yup, but the question is... Do we want it to behave this way?
--
Jason L. Froebe

Help find a cure for breast cancer! Net proceeds benefit the Susan G.
Komen Breast Cancer Foundation and the National Philanthropic Trust.
Help by donating at http://www.the3day.org/chicago07/jfroebe - I'm
walking 60 miles in 3 days in August 2007. (The day I return from
TechWave is the first day of the Walk)

WebBlog http://jfroebe.livejournal.com
Tech log http://www.froebe.net/blog