ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Timestamp does npot work

Post new topic  Reply to topic
 Timestamp does npot work « View previous topic :: View next topic » 
Author Message
kuzman
PostPosted: Thu Sep 02, 2010 6:09 am    Post subject: Timestamp does npot work Reply with quote

Apprentice

Joined: 24 Aug 2010
Posts: 27

Hi,

I would like to subtract two timestamp but it returns null:
DECLARE T2 TIMESTAMP;
SET T2 = CURRENT_TIMESTAMP;
DECLARE T1 TIMESTAMP;
SET T1 = CAST('2010-01-01 12:00:00' AS TIMESTAMP);
SET OutputRoot.XMLNSC.DAY_ELAPSED = (T2-T1) DAY;

The OutputRoot.XMLNSC.DAY_ELAPSED is null ???

I have finded esql example, that also don't work:
Declare D Interval (CURRENT_DATE - Date '2010-01-01') DAY;
Declare H Interval (CURRENT_TIME - Time '12:00:00') HOUR TO SECOND;

D and H are also null! ??

Br,

Zs
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Sep 02, 2010 7:03 am    Post subject: Re: Timestamp does npot work Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kuzman wrote:
I have finded esql example, that also don't work:


Finded where? It looks a bit odd.

I'd consider something more like this (untested) snippet:

Code:
SET OutputRoot.XMLNSC.DAY_ELAPSED = EXTRACT DAY FROM(T2-T1)


Also I don't think you can initialise an INTERVAL data type like this:

Code:
Declare D Interval (CURRENT_DATE - Date '2010-01-01') DAY;
Declare H Interval (CURRENT_TIME - Time '12:00:00') HOUR TO SECOND;


You need to look up CAST, INTERVAL & EXTRACT in the InfoCenter. There are some code snippits there which might be useful.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Timestamp does npot work
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.