Author |
Message
|
Vgowda |
Posted: Tue Jan 31, 2012 4:10 am Post subject: Difference between Time |
|
|
 Acolyte
Joined: 11 Dec 2007 Posts: 61 Location: Bengaluru
|
Hi,
I am trying to find the difference between Time in the ESQL code. My ESQL code look like this :
Quote: |
DECLARE duration INTERVAL;
DECLARE sttime TIME SvcInfoRef.StartTime;
DECLARE endtime TIME SvcInfoRef.EndTime;
SET duration = (sttime - endtime) MINUTE TO SECOND ; |
In Debug mode the values are
Quote: |
sttime :17:34:01.350
endtime :17:34:03.798 |
But the duration value is NULL. Not able to figure it out where is the error.
Can anybody throw me the thoughts on the same _________________ Regards
Vinay |
|
Back to top |
|
 |
adubya |
Posted: Tue Jan 31, 2012 4:14 am Post subject: |
|
|
Partisan
Joined: 25 Aug 2011 Posts: 377 Location: GU12, UK
|
Don't you want to subtract starttime from endtime ? You're currently the "wrong" way round. |
|
Back to top |
|
 |
mgk |
Posted: Tue Jan 31, 2012 4:29 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
But the duration value is NULL |
Try looking at the output in a message or in Usertrace. I believe the debugger cannot display an INTERVAL type correctly, but the data really is there...
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
Vgowda |
Posted: Tue Jan 31, 2012 4:48 am Post subject: |
|
|
 Acolyte
Joined: 11 Dec 2007 Posts: 61 Location: Bengaluru
|
@adubya : Its the same if i place the other round as well.
@mgk : I am assigning the duration value to Environment Variable as shown below, still the value is NULL.
Quote: |
SET Environment.SvcDetails.ServiceInfo.Duration = duration |
_________________ Regards
Vinay |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 31, 2012 4:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vgowda wrote: |
@mgk : I am assigning the duration value to Environment Variable as shown below, still the value is NULL.
Quote: |
SET Environment.SvcDetails.ServiceInfo.Duration = duration |
|
That doesn't change the fact that the value is an Interval, and that it's likely that the debugger can't display INTERVAL values.
User Trace will show you this data clearly. |
|
Back to top |
|
 |
Vgowda |
Posted: Tue Jan 31, 2012 5:08 am Post subject: |
|
|
 Acolyte
Joined: 11 Dec 2007 Posts: 61 Location: Bengaluru
|
@mqjeff : I am passing SvcDetails Environment reference from my code for logging, now i casted the duration to Character now it is able to display the difference.
Quote: |
DECLARE Var CHARACTER CAST(duration AS CHARACTER).
INTERVAL '0.061464' SECOND |
Dont you feel this is a bug in WMBtoolkit? Wasted half day to check why it was getting value NULL .
Anyways Thank you _________________ Regards
Vinay |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 31, 2012 5:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vgowda wrote: |
@mqjeff : I am passing SvcDetails Environment reference from my code for logging, now i casted the duration to Character now it is able to display the difference.
Quote: |
DECLARE Var CHARACTER CAST(duration AS CHARACTER).
INTERVAL '0.061464' SECOND |
Dont you feel this is a bug in WMBtoolkit? Wasted half day to check why it was getting value NULL . |
Well, yes, I would personally consider this a bug in the Toolkit. And if I had been running into it, I would have a) opened a PMR, b) taken a user trace anyway just to confirm that I wasn't hitting issues with the debugger. But despite the best efforts of the Toolkit team, I'm still suspicious of the debugger. but then again, I'm still smarting from the dead-on-arrival of Broker version 5.0, so I probably hold onto things too long. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 31, 2012 6:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Vgowda wrote: |
Dont you feel this is a bug in WMBtoolkit? Wasted half day to check why it was getting value NULL . |
So you've discovered what all WMB people discover; the debugger has limitations.
You'll find any number of posts on this forum on this subject. All of them result in the advice "take a user trace". _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|