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 » Current_timestamp

Post new topic  Reply to topic
 Current_timestamp « View previous topic :: View next topic » 
Author Message
narendrach
PostPosted: Thu Mar 02, 2006 8:54 am    Post subject: Current_timestamp Reply with quote

Voyager

Joined: 29 Jun 2005
Posts: 78

Hi...

I am passing Current_TimeStamp to a Environment variable

SET Environment.currenttime=Current_TimeStamp;

it is working successfully But

when getting a substring of the Environment.currenttime variable

such as SUBSTRING(Environment.currenttime FROM 1 to 4);

it is giving me a error ..

What is the return type of the Current_TimeStamp Function

BUT When i cast CAST(Environment.currenttime as CHARECTER);
it is working fine

i need to know what is the return type of the Current_TimeStamp
_________________
Narendra CH
Back to top
View user's profile Send private message Yahoo Messenger
fschofer
PostPosted: Thu Mar 02, 2006 9:05 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi,

its documented in the WMB manuals =>

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05450_.htm?resultof=%22%54%69%6d%65%53%74%61%6d%70%22%20%22%74%69%6d%65%73%74%61%6d%70%22%20

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak17890_.htm?resultof=%22%54%69%6d%65%53%74%61%6d%70%22%20%22%74%69%6d%65%73%74%61%6d%70%22%20

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
madi
PostPosted: Thu Mar 02, 2006 9:49 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

SUBSTRING(CAST(CURRENT_TIME AS CHAR) FROM 1 for 4);

if you havent already found it

--madi
Back to top
View user's profile Send private message
Bill.Matthews
PostPosted: Thu Mar 02, 2006 10:48 am    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

If you are running WMB V6 then you now have the ability to use the FORAMT pattern option on a cast. Thus, it becomes much easier to extract time information or dates, etc and cast them as charbstring.acters - without using the substring. In addition, there are several new wasy of managing dates. Let me give you an example: Here we have a date value given with a mixture of alpha values and numerics - this is an actual date that came from a web service - the objective of this code was to change the value into all numerics ans as a character string. While one could combine some steps together - individual steps are shown for clarity.

-- WSDate was taken from a soap trace
Declare WSDate CHAR 'Wed Feb 22 13:32:14 PST 2006';

DECLARE MyTimeStamp TIMESTAMP;
Declare pattern CHAR 'EEE MMM dd HH:mm:ss zzz yyyy';

set Environment.WSDate = WSDate;
set Environment.pattern = pattern;

Set MyTimeStamp = Cast(WSDate as TIMESTAMP FORMAT pattern);
set Environment.MyTimeStamp = MyTimeStamp;

Declare DB2Date CHAR
CAST(EXTRACT(YEAR FROM MyTimeStamp) AS CHAR FORMAT '0000') || '-' ||
CAST(EXTRACT(MONTH FROM MyTimeStamp) AS CHAR FORMAT '00') || '-' ||
CAST(EXTRACT(DAY FROM MyTimeStamp) AS CHAR FORMAT '00') || '-' ||
CAST(EXTRACT(HOUR FROM MyTimeStamp) AS CHAR FORMAT '00') || '.' ||
CAST(EXTRACT(MINUTE FROM MyTimeStamp) AS CHAR FORMAT '00') || '.' ||
CAST(EXTRACT(SECOND FROM MyTimeStamp) AS CHAR FORMAT '00') || '.' ||
'000000';
set Environment.DB2Date = DB2Date;
/* the Environment values are:
WSDate = 'Wed Feb 22 13:32:14 PST 2006'
pattern = 'EEE MMM dd HH:mm:ss zzz yyyy'
MyTimeStamp = TIMESTAMP '2006-02-23 03:32:14'
DB2Date = '2006-02-23-03.32.14.000000'
mytime = 'TIMESTAMP '2006-02-23 03:32:14''
myftime = '2006-02-23 03:32:14'
*/
_________________
Bill Matthews
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 » Current_timestamp
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.