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.

incorrect results for @@ERROR, @@ROWCOUNT after select statement in ASA 8.0.1 (2600)

3 posts in General Discussion Last posting was on 2002-08-22 12:34:54.0Z
Matt Hughes Posted on 2002-08-08 18:17:03.0Z
From: "Matt Hughes" <mhughes@navicare.com>
Subject: incorrect results for @@ERROR, @@ROWCOUNT after select statement in ASA 8.0.1 (2600)
Date: Thu, 8 Aug 2002 13:17:03 -0500
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <wkV#JmwPCHA.197@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: pppdslc8.mpls.uswest.net 216.160.21.8
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:693
Article PK: 2685

Hi:

I'm using ASA 8.0.1 (build 2600). In a stored procedure I am running a
select statement that should return zero records. If I use the syntax:

select @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT

(notice the comma) I should be able to set both of these variables based on
the previous select statement. It appears this stopped working somewhere
between 7.0.4 and 8.0.1. It returns a rowcount of "1". Here's some sample
code:

create procedure sybprob001() as
begin
declare @error_var int,
@rowcount_var int,
@table_name varchar(256)

select @table_name = table_name from sys.systable where table_name like
'%blah%'
select @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT
message 'error_var should be 0, is ',@error_var
message 'rowcount_var should be 0, is ',@rowcount_var
print 'error_var should be 0, is %1! ',@error_var
print 'rowcount_var should be 0, is %1! ',@rowcount_var
end

Is this syntax still legitimate? If not, how could I possibly check both
for an error and the rowcount? Appears to me to be a new bug.

Thanks in advance!
--
Matt


Matt Hughes Posted on 2002-08-22 12:34:54.0Z
From: "Matt Hughes" <mhughes@navicare.com>
References: <wkV#JmwPCHA.197@forums.sybase.com>
Subject: Re: incorrect results for @@ERROR, @@ROWCOUNT after select statement in ASA 8.0.1 (2600)
Date: Thu, 22 Aug 2002 07:34:54 -0500
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <mchPhodSCHA.310@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: hdslppp39.mpls.uswest.net 63.225.144.39
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:671
Article PK: 2677

Following up on my own question, this is purported to be fixed in QTS
292514, which is to be included in the next EBF and in turn subsequent
releases.

"Matt Hughes" <mhughes@navicare.com> wrote in message
news:wkV#JmwPCHA.197@forums.sybase.com...
> Hi:
>
> I'm using ASA 8.0.1 (build 2600). In a stored procedure I am running a
> select statement that should return zero records. If I use the syntax:
>
> select @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT
>
> (notice the comma) I should be able to set both of these variables based
on
> the previous select statement. It appears this stopped working somewhere
> between 7.0.4 and 8.0.1. It returns a rowcount of "1". Here's some
sample
> code:
>
> create procedure sybprob001() as
> begin
> declare @error_var int,
> @rowcount_var int,
> @table_name varchar(256)
>
> select @table_name = table_name from sys.systable where table_name like
> '%blah%'
> select @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT
> message 'error_var should be 0, is ',@error_var
> message 'rowcount_var should be 0, is ',@rowcount_var
> print 'error_var should be 0, is %1! ',@error_var
> print 'rowcount_var should be 0, is %1! ',@rowcount_var
> end
>
> Is this syntax still legitimate? If not, how could I possibly check both
> for an error and the rowcount? Appears to me to be a new bug.
>
> Thanks in advance!
> --
> Matt
>
>


Robert Waywell Posted on 2002-08-08 21:03:19.0Z
From: "Robert Waywell" <rwaywell@ianywhere.com>
References: <wkV#JmwPCHA.197@forums.sybase.com>
Subject: Re: incorrect results for @@ERROR, @@ROWCOUNT after select statement in ASA 8.0.1 (2600)
Date: Thu, 8 Aug 2002 17:03:19 -0400
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <tDsNlc1UCHA.81@forums.sybase.com>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub ianywhere.public.general:648
Article PK: 3171

The syntax should still be legitimate. Can you submit the bug report through
Case Express? The link is below.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

"Matt Hughes" <mhughes@navicare.com> wrote in message
news:wkV#JmwPCHA.197@forums.sybase.com...
> Hi:
>
> I'm using ASA 8.0.1 (build 2600). In a stored procedure I am running a
> select statement that should return zero records. If I use the syntax:
>
> select @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT
>
> (notice the comma) I should be able to set both of these variables based
on
> the previous select statement. It appears this stopped working somewhere
> between 7.0.4 and 8.0.1. It returns a rowcount of "1". Here's some
sample
> code:
>
> create procedure sybprob001() as
> begin
> declare @error_var int,
> @rowcount_var int,
> @table_name varchar(256)
>
> select @table_name = table_name from sys.systable where table_name like
> '%blah%'
> select @error_var = @@ERROR, @rowcount_var = @@ROWCOUNT
> message 'error_var should be 0, is ',@error_var
> message 'rowcount_var should be 0, is ',@rowcount_var
> print 'error_var should be 0, is %1! ',@error_var
> print 'rowcount_var should be 0, is %1! ',@rowcount_var
> end
>
> Is this syntax still legitimate? If not, how could I possibly check both
> for an error and the rowcount? Appears to me to be a new bug.
>
> Thanks in advance!
> --
> Matt
>
>