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 » Convert ESQL TIMESTAMP format to Oracle TIMESTAMP format

Post new topic  Reply to topic
 Convert ESQL TIMESTAMP format to Oracle TIMESTAMP format « View previous topic :: View next topic » 
Author Message
Fresher_Newbie
PostPosted: Fri Jun 26, 2015 10:26 am    Post subject: Convert ESQL TIMESTAMP format to Oracle TIMESTAMP format Reply with quote

Novice

Joined: 24 Jun 2015
Posts: 13

Hello folks,

Is there any way I can convert the value returned by the CURRENT_TIMESTAMP function (Ex: 2015-06-26 08:30:00.000000) in ESQL to ORACLE TIMESTAMP format (Ex: 26-JUN-15 08.30.00.000000000 AM)?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 26, 2015 10:42 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Cast to character with format clause?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Jun 26, 2015 10:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Oracle should convert a timestamp into a timestamp.

Neither of which should have a format.
Back to top
View user's profile Send private message
Fresher_Newbie
PostPosted: Fri Jun 26, 2015 11:49 am    Post subject: Reply with quote

Novice

Joined: 24 Jun 2015
Posts: 13

@fjp

Thanks, I've done the same as shown below:

SET CUR_T = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'dd-MMM-yy hh.mm.ss.SSSSSSSSS');

But also need to include the AM/PM part. How do I do that? Excuse my ignorance, but I'm really new to this.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 26, 2015 12:02 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Fresher_Newbie wrote:
@fjp

Thanks, I've done the same as shown below:

SET CUR_T = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'dd-MMM-yy hh.mm.ss.SSSSSSSSS');

But also need to include the AM/PM part. How do I do that? Excuse my ignorance, but I'm really new to this.

Look up the documentation. I believe you have to use HH vs hh and add A somewhere in the template...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Fresher_Newbie
PostPosted: Fri Jun 26, 2015 12:09 pm    Post subject: Reply with quote

Novice

Joined: 24 Jun 2015
Posts: 13

HH gives you the 24 hour format
hh gives you the 12 hour format, but neither with an AM/PM marker.

Hmm, all right I'll look it up, again. Thanks!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 26, 2015 12:13 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

fjb_saper wrote:
Fresher_Newbie wrote:
@fjp

Thanks, I've done the same as shown below:

SET CUR_T = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'dd-MMM-yy hh.mm.ss.SSSSSSSSS');

But also need to include the AM/PM part. How do I do that? Excuse my ignorance, but I'm really new to this.

Look up the documentation. I believe you have to use HH vs hh and add A somewhere in the template...

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Jun 26, 2015 12:24 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Fresher_Newbie wrote:
Thanks, I've done the same as shown below:

SET CUR_T = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'dd-MMM-yy hh.mm.ss.SSSSSSSSS');


Why?

What happens when you don't bother casting it at all, just put the plain timestamp into the insert statement?
Back to top
View user's profile Send private message
Fresher_Newbie
PostPosted: Fri Jun 26, 2015 12:41 pm    Post subject: Reply with quote

Novice

Joined: 24 Jun 2015
Posts: 13

Addidng the 'a' did it.

mqjeff - I needed to use it in the SELECT statement to retrieve some records off the ORACLE database, where the TIMESTAMP coloumn is stored in dd-MMM-yy hh.mm.ss.SSSSSSSSS format. It wouldn't work with the plain timestamp.

Anyway, I got it now. Thanks both of you.
Back to top
View user's profile Send private message
Simbu
PostPosted: Mon Jun 29, 2015 3:30 am    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

Hi, There is no ESQL data type available for Oracle TIMESTAMP datatype. Oracle Datatype DATE will map to ESQL TIMESTAMP automatically.
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 » Convert ESQL TIMESTAMP format to Oracle TIMESTAMP format
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.