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 » Query on Format of current_timestamp

Post new topic  Reply to topic
 Query on Format of current_timestamp « View previous topic :: View next topic » 
Author Message
Meetraj
PostPosted: Wed Aug 31, 2005 5:46 am    Post subject: Query on Format of current_timestamp Reply with quote

Novice

Joined: 02 Jul 2005
Posts: 18
Location: India.

Hi Every body,

In one of my scenario i got a situation like i have to format my date format as MMddyy_hhmmss_sss.I tried up to some extent and i am getting output as '20050831_092353_679' using string manipulation functions.Now,my requirement is to move the year field to the end of date field.So please suggest me a way to solve the problem.


Thank You.
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Aug 31, 2005 5:55 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Interesting format ... you can use substring to pick out and then re-assemble the string into that format.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
JT
PostPosted: Wed Aug 31, 2005 6:00 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Post the ESQL you developed to create '20050831_092353_679' .
Back to top
View user's profile Send private message
Balakrishna
PostPosted: Wed Aug 31, 2005 6:04 am    Post subject: Query on Format of current_timestamp Reply with quote

Newbie

Joined: 30 Jun 2005
Posts: 5

--Set the TimeStamp in RequiredFormat. <Data>regtfe</Data>
SET cNewTimeStampMM = SUBSTRING(CAST(CURRENT_TIMESTAMP AS CHAR) FROM 17 FOR 2);
SET cNewTimeStampDD = SUBSTRING(CAST(CURRENT_TIMESTAMP AS CHAR) FROM 20 FOR 2);
SET cNewTimeStampYY = SUBSTRING(CAST(CURRENT_TIMESTAMP AS CHAR) FROM 12 FOR 4);
SET cTimeStamp = SUBSTRING(CAST(CURRENT_TIMESTAMP AS CHAR) FROM 23 FOR ;
SET cNewTimeStamphhmmss = REPLACE(REPLACE(cTimeStamp,':',''),':','');
SET cNewTimeStampSSS = SUBSTRING(CAST(CURRENT_TIMESTAMP AS CHAR) FROM 32 FOR 3);


--Creating the Target FileName with CurrentTimeStamp like MMDDYY_hhmmss_SSS

SET cNewDate=cNewTimeStampMM ||cNewTimeStampDD|| cNewTimeStampYY||'_'||cNewTimeStamphhmmss ||'_'||cNewTimeStampSSS;
Back to top
View user's profile Send private message
Meetraj
PostPosted: Wed Aug 31, 2005 6:06 am    Post subject: Thank you Reply with quote

Novice

Joined: 02 Jul 2005
Posts: 18
Location: India.

wschutz wrote:
Interesting format ... you can use substring to pick out and then re-assemble the string into that format.



I want a method which won't effect to performance of my code.The method which is specified will definitely work fine as i already tried that one appending each and every field as i required after extrcating from timestamp.

Thank you though.
Back to top
View user's profile Send private message
JT
PostPosted: Wed Aug 31, 2005 6:13 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

You can also use the Extract function to constitute your unique date/time stamp.
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 » Query on Format of 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.