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.

Why "set flushmessage " make no effort?

5 posts in General Discussion Last posting was on 2012-05-22 02:44:18.0Z
Eisen Posted on 2012-05-17 06:53:08.0Z
Sender: 4eb8.4fb49c20.1804289383@sybase.com
From: Eisen
Newsgroups: sybase.public.ase.general
Subject: Why "set flushmessage " make no effort?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4fb4a054.4f67.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 16 May 2012 23:53:08 -0700
X-Trace: forums-1-dub 1337237588 172.20.134.41 (16 May 2012 23:53:08 -0700)
X-Original-Trace: 16 May 2012 23:53:08 -0700, 172.20.134.41
Lines: 40
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31114
Article PK: 74003

Dear all
Currently I need to check the status of batch running. So
I wrote a code to trace it --
declare @pre int,@cnt int
select @pre=count(*) from dbo.CMC_CLCL_CLAIM where
CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
while exists(select 1 from CMC_CLCL_CLAIM where
CLST_MCTR_REAS='CL66' and CLCL_CUR_STS='11')
begin
waitfor delay '00:01:00'
select @cnt=count(*) from dbo.CMC_CLCL_CLAIM where
CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
select "Now:"+convert(varchar,getdate(),117),@pre-@cnt,@cnt
select @pre=@cnt
end
go

I think it would report me how many claims left every
minute, but I soon found it only burst each 20 minutes or
more with a series output in isql. I think it's due to the
message buffer. So I add a "set flushmessage on" before my
code and rerun it. But to my surprise, it's nothing changed.
The output still stored in the buffer and not show on the
screen each minute. I check again with the manual --

set flushmessage {on | off}
determines when Adaptive Server returns messages to the
user. By default, messages are stored in a buffer until the
query that generated them is completed or the buffer is
filled to capacity. Use set flushmessage on to return
messages to the user immediately, as they are generated.

in
http://infocenter.sybase.com/help/index.jsp?docset=/com.sybase.infocenter.help.ase.15.5/title.htm&docSetID=1637

I'm not sure it's due to my understanding error or the
select is not the "message" in manual? Thanks.

Best Regards
Eisen


"Mark A. Parsons" <iron_horse Posted on 2012-05-17 12:24:03.0Z
From: "Mark A. Parsons" <iron_horse@no_spamola.compuserve.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Why "set flushmessage " make no effort?
References: <4fb4a054.4f67.1681692777@sybase.com>
In-Reply-To: <4fb4a054.4f67.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4fb4ede3@forums-1-dub>
Date: 17 May 2012 05:24:03 -0700
X-Trace: forums-1-dub 1337257443 10.22.241.152 (17 May 2012 05:24:03 -0700)
X-Original-Trace: 17 May 2012 05:24:03 -0700, vip152.sybase.com
Lines: 47
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31115
Article PK: 74005

'flushmessage' only applies to 'print' commands (and perhaps 'raiserror'). And yes, when you issue a 'print' command it
will also flush the output from any previous 'select' commands.

Consider adding a 'print ""' in your code at the point where you'd like to have instant access to your output.
Alternatively, replace a select (eg, select "Now:"...) with a 'select @var=<output_string> print @var' chunk of code.

On 05/17/2012 00:53, Eisen wrote:
> Dear all
> Currently I need to check the status of batch running. So
> I wrote a code to trace it --
> declare @pre int,@cnt int
> select @pre=count(*) from dbo.CMC_CLCL_CLAIM where
> CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
> while exists(select 1 from CMC_CLCL_CLAIM where
> CLST_MCTR_REAS='CL66' and CLCL_CUR_STS='11')
> begin
> waitfor delay '00:01:00'
> select @cnt=count(*) from dbo.CMC_CLCL_CLAIM where
> CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
> select "Now:"+convert(varchar,getdate(),117),@pre-@cnt,@cnt
> select @pre=@cnt
> end
> go
>
> I think it would report me how many claims left every
> minute, but I soon found it only burst each 20 minutes or
> more with a series output in isql. I think it's due to the
> message buffer. So I add a "set flushmessage on" before my
> code and rerun it. But to my surprise, it's nothing changed.
> The output still stored in the buffer and not show on the
> screen each minute. I check again with the manual --
>
> set flushmessage {on | off}
> determines when Adaptive Server returns messages to the
> user. By default, messages are stored in a buffer until the
> query that generated them is completed or the buffer is
> filled to capacity. Use set flushmessage on to return
> messages to the user immediately, as they are generated.
>
> in
> http://infocenter.sybase.com/help/index.jsp?docset=/com.sybase.infocenter.help.ase.15.5/title.htm&docSetID=1637
>
> I'm not sure it's due to my understanding error or the
> select is not the "message" in manual? Thanks.
>
> Best Regards
> Eisen


Eisen Posted on 2012-05-18 02:59:12.0Z
Sender: 5413.4fb4bf53.1804289383@sybase.com
From: Eisen
Newsgroups: sybase.public.ase.general
Subject: Re: Why "set flushmessage " make no effort?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4fb5bb00.7867.1681692777@sybase.com>
References: <4fb4ede3@forums-1-dub>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 17 May 2012 19:59:12 -0700
X-Trace: forums-1-dub 1337309952 172.20.134.41 (17 May 2012 19:59:12 -0700)
X-Original-Trace: 17 May 2012 19:59:12 -0700, 172.20.134.41
Lines: 68
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31120
Article PK: 74008

Hi Mark
Thanks a lot for your help. Yes, that "flushmessage" is
only for "print". But sometimes, DBA also have to use
"select" to check status -- such as the hot tables and
UsedCount in monOpenObjectActivity in batch running eg.
select top 5 DBID,ObjectID,UsedCount from
monOpenObjectActivity order by ...
I think in this scenario the "print" can't replace
"select", do you have anyother choice to refresh the output
of "select" in real time? Thanks again.

Best Regards
Eisen

> 'flushmessage' only applies to 'print' commands (and
> perhaps 'raiserror'). And yes, when you issue a 'print'
> command it will also flush the output from any previous
> 'select' commands.
>
> Consider adding a 'print ""' in your code at the point
> where you'd like to have instant access to your output.
> Alternatively, replace a select (eg, select "Now:"...)
> with a 'select @var=<output_string> print @var' chunk of
> code.
>
> On 05/17/2012 00:53, Eisen wrote:
> > Dear all
> > Currently I need to check the status of batch
> > running. So I wrote a code to trace it --
> > declare @pre int,@cnt int
> > select @pre=count(*) from dbo.CMC_CLCL_CLAIM where
> > CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
> > while exists(select 1 from CMC_CLCL_CLAIM where
> > CLST_MCTR_REAS='CL66' and CLCL_CUR_STS='11')
> > begin
> > waitfor delay '00:01:00'
> > select @cnt=count(*) from dbo.CMC_CLCL_CLAIM where
> > CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
> > select "Now:"+convert(varchar,getdate(),117)
> > ,@pre-@cnt,@cnt select @pre=@cnt
> > end
> > go
> >
> > I think it would report me how many claims left
> > every minute, but I soon found it only burst each 20
> > minutes or more with a series output in isql. I think
> > it's due to the message buffer. So I add a "set
> > flushmessage on" before my code and rerun it. But to my
> > surprise, it's nothing changed. The output still stored
> > in the buffer and not show on the screen each minute. I
> check again with the manual -- >
> > set flushmessage {on | off}
> > determines when Adaptive Server returns messages to the
> > user. By default, messages are stored in a buffer until
> > the query that generated them is completed or the buffer
> > is filled to capacity. Use set flushmessage on to return
> > messages to the user immediately, as they are generated.
> >
> > in
> >
>
http://infocenter.sybase.com/help/index.jsp?docset=/com.sybase.infocenter.help.ase.15.5/title.htm&docSetID=1637
> >
> > I'm not sure it's due to my understanding error or
> > the select is not the "message" in manual? Thanks.
> >
> > Best Regards
> > Eisen


"Mark A. Parsons" <iron_horse Posted on 2012-05-18 12:41:00.0Z
From: "Mark A. Parsons" <iron_horse@no_spamola.compuserve.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Why "set flushmessage " make no effort?
References: <4fb4ede3@forums-1-dub> <4fb5bb00.7867.1681692777@sybase.com>
In-Reply-To: <4fb5bb00.7867.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4fb6435c@forums-1-dub>
Date: 18 May 2012 05:41:00 -0700
X-Trace: forums-1-dub 1337344860 10.22.241.152 (18 May 2012 05:41:00 -0700)
X-Original-Trace: 18 May 2012 05:41:00 -0700, vip152.sybase.com
Lines: 80
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31123
Article PK: 74015

What's wrong with the examples I gave in my previous post?

For your original example:

select @now=convert(varchar,getdate(),117),@diff=@pre-@cnt
print "Now: %1! %2! %3!",@now,@diff,@cnt

And generally speaking, just print a blank line:

print ""

On 05/17/2012 20:59, Eisen wrote:
> Hi Mark
> Thanks a lot for your help. Yes, that "flushmessage" is
> only for "print". But sometimes, DBA also have to use
> "select" to check status -- such as the hot tables and
> UsedCount in monOpenObjectActivity in batch running eg.
> select top 5 DBID,ObjectID,UsedCount from
> monOpenObjectActivity order by ...
> I think in this scenario the "print" can't replace
> "select", do you have anyother choice to refresh the output
> of "select" in real time? Thanks again.
>
> Best Regards
> Eisen
>
>> 'flushmessage' only applies to 'print' commands (and
>> perhaps 'raiserror'). And yes, when you issue a 'print'
>> command it will also flush the output from any previous
>> 'select' commands.
>>
>> Consider adding a 'print ""' in your code at the point
>> where you'd like to have instant access to your output.
>> Alternatively, replace a select (eg, select "Now:"...)
>> with a 'select @var=<output_string> print @var' chunk of
>> code.
>>
>> On 05/17/2012 00:53, Eisen wrote:
>>> Dear all
>>> Currently I need to check the status of batch
>>> running. So I wrote a code to trace it --
>>> declare @pre int,@cnt int
>>> select @pre=count(*) from dbo.CMC_CLCL_CLAIM where
>>> CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
>>> while exists(select 1 from CMC_CLCL_CLAIM where
>>> CLST_MCTR_REAS='CL66' and CLCL_CUR_STS='11')
>>> begin
>>> waitfor delay '00:01:00'
>>> select @cnt=count(*) from dbo.CMC_CLCL_CLAIM where
>>> CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
>>> select "Now:"+convert(varchar,getdate(),117)
>>> ,@pre-@cnt,@cnt select @pre=@cnt
>>> end
>>> go
>>>
>>> I think it would report me how many claims left
>>> every minute, but I soon found it only burst each 20
>>> minutes or more with a series output in isql. I think
>>> it's due to the message buffer. So I add a "set
>>> flushmessage on" before my code and rerun it. But to my
>>> surprise, it's nothing changed. The output still stored
>>> in the buffer and not show on the screen each minute. I
>> check again with the manual -->
>>> set flushmessage {on | off}
>>> determines when Adaptive Server returns messages to the
>>> user. By default, messages are stored in a buffer until
>>> the query that generated them is completed or the buffer
>>> is filled to capacity. Use set flushmessage on to return
>>> messages to the user immediately, as they are generated.
>>>
>>> in
>>>
>>
> http://infocenter.sybase.com/help/index.jsp?docset=/com.sybase.infocenter.help.ase.15.5/title.htm&docSetID=1637
>>>
>>> I'm not sure it's due to my understanding error or
>>> the select is not the "message" in manual? Thanks.
>>>
>>> Best Regards
>>> Eisen


Eisen Posted on 2012-05-22 02:44:18.0Z
Sender: 677a.4fbafb3a.1804289383@sybase.com
From: Eisen
Newsgroups: sybase.public.ase.general
Subject: Re: Why "set flushmessage " make no effort?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4fbafd82.67e1.1681692777@sybase.com>
References: <4fb6435c@forums-1-dub>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 21 May 2012 19:44:18 -0700
X-Trace: forums-1-dub 1337654658 172.20.134.41 (21 May 2012 19:44:18 -0700)
X-Original-Trace: 21 May 2012 19:44:18 -0700, 172.20.134.41
Lines: 90
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31130
Article PK: 74019

Hi Mark
Sorry. It's my fault that I didn't understand what you
mean in last post. Thanks again for your patience and help.

Best Regards
Eisen

> What's wrong with the examples I gave in my previous post?
>
> For your original example:
>
> select @now=convert(varchar,getdate(),117)
> ,@diff=@pre-@cnt
> print "Now: %1! %2! %3!",@now,@diff,@cnt
>
> And generally speaking, just print a blank line:
>
> print ""
>
> On 05/17/2012 20:59, Eisen wrote:
> > Hi Mark
> > Thanks a lot for your help. Yes, that "flushmessage"
> > is only for "print". But sometimes, DBA also have to use
> > "select" to check status -- such as the hot tables and
> > UsedCount in monOpenObjectActivity in batch running eg.
> > select top 5 DBID,ObjectID,UsedCount from
> > monOpenObjectActivity order by ...
> > I think in this scenario the "print" can't replace
> > "select", do you have anyother choice to refresh the
> > output of "select" in real time? Thanks again.
> >
> > Best Regards
> > Eisen
> >
> >> 'flushmessage' only applies to 'print' commands (and
> >> perhaps 'raiserror'). And yes, when you issue a
> 'print' >> command it will also flush the output from any
> previous >> 'select' commands.
> >>
> >> Consider adding a 'print ""' in your code at the point
> >> where you'd like to have instant access to your output.
> >> Alternatively, replace a select (eg, select "Now:"...)
> >> with a 'select @var=<output_string> print @var' chunk
> of >> code.
> >>
> >> On 05/17/2012 00:53, Eisen wrote:
> >>> Dear all
> >>> Currently I need to check the status of batch
> >>> running. So I wrote a code to trace it --
> >>> declare @pre int,@cnt int
> >>> select @pre=count(*) from dbo.CMC_CLCL_CLAIM where
> >>> CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
> >>> while exists(select 1 from CMC_CLCL_CLAIM where
> >>> CLST_MCTR_REAS='CL66' and CLCL_CUR_STS='11')
> >>> begin
> >>> waitfor delay '00:01:00'
> >>> select @cnt=count(*) from dbo.CMC_CLCL_CLAIM
> where >>> CLST_MCTR_REAS = 'CL66' AND CLCL_CUR_STS = '11'
> >>> select "Now:"+convert(varchar,getdate(),117)
> >>> ,@pre-@cnt,@cnt select @pre=@cnt
> >>> end
> >>> go
> >>>
> >>> I think it would report me how many claims left
> >>> every minute, but I soon found it only burst each 20
> >>> minutes or more with a series output in isql. I think
> >>> it's due to the message buffer. So I add a "set
> >>> flushmessage on" before my code and rerun it. But to
> my >>> surprise, it's nothing changed. The output still
> stored >>> in the buffer and not show on the screen each
> minute. I >> check again with the manual -->
> >>> set flushmessage {on | off}
> >>> determines when Adaptive Server returns messages to
> the >>> user. By default, messages are stored in a buffer
> until >>> the query that generated them is completed or
> the buffer >>> is filled to capacity. Use set flushmessage
> on to return >>> messages to the user immediately, as they
> are generated. >>>
> >>> in
> >>>
> >>
> >
>
http://infocenter.sybase.com/help/index.jsp?docset=/com.sybase.infocenter.help.ase.15.5/title.htm&docSetID=1637
> >>>
> >>> I'm not sure it's due to my understanding error
> or >>> the select is not the "message" in manual? Thanks.
> >>>
> >>> Best Regards
> >>> Eisen