dbTalk Databases Forums  

Sybase 12.5 Transact SQL query

comp.databases.sybase comp.databases.sybase


Discuss Sybase 12.5 Transact SQL query in the comp.databases.sybase forum.



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

Default Sybase 12.5 Transact SQL query - 07-14-2004 , 02:14 AM






Hi,

I am using Rapid SQL 7.2.1 on Windows XP to access Sybase 12.5.0.1
using Transact SQL.

When I declare a number of variables in Transact SQL and then give the
variables a value using the select statement and run it, I get the "1
row(s) affected." message for each variable I set a value for. How
can I stop SQL/Rapid from outputting this message while still allowing
the actual select query statmennts to return values.

Here is an example of how I am declaring and setting values:

create table #report
(id int, report char(20))
insert into #report (id,report) values (3, "Report name")

declare @repid int
select @repid = (select dbo.rep.id from dbo.rep where
dbo.rep.report_name in
(select report from #report where id =3))

declare @runfilter1 int
select @runfilter1 = (select run_filter_1 from dbo.rep_run where id =
@repid)

The SQL above would have returned "1 row(s) affected." twice where I
would like it not to return any message as I am simply setting up
variables.

Any help on this would be greatly appreciated.

thanks
Brendan

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

Default Re: Sybase 12.5 Transact SQL query - 07-14-2004 , 04:10 AM






On Wed, 14 Jul 2004 00:14:26 -0700, brendang wrote:

Quote:
Hi,

I am using Rapid SQL 7.2.1 on Windows XP to access Sybase 12.5.0.1 using
Transact SQL.

When I declare a number of variables in Transact SQL and then give the
variables a value using the select statement and run it, I get the "1
row(s) affected." message for each variable I set a value for. How can I
stop SQL/Rapid from outputting this message
Try running:

set nocount on

before running your query.

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



Reply With Quote
  #3  
Old   
brendang
 
Posts: n/a

Default Re: Sybase 12.5 Transact SQL query - 07-19-2004 , 08:09 AM



Thanks for taking the time to reply to my query. Your suggestion worked perfectly.
Brendan

Michael Peppler <mpeppler (AT) peppler (DOT) org> wrote

Quote:
On Wed, 14 Jul 2004 00:14:26 -0700, brendang wrote:

Hi,

I am using Rapid SQL 7.2.1 on Windows XP to access Sybase 12.5.0.1 using
Transact SQL.

When I declare a number of variables in Transact SQL and then give the
variables a value using the select statement and run it, I get the "1
row(s) affected." message for each variable I set a value for. How can I
stop SQL/Rapid from outputting this message

Try running:

set nocount on

before running your query.

Michael

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.