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 » Date conversion

Post new topic  Reply to topic
 Date conversion « View previous topic :: View next topic » 
Author Message
jeasterl
PostPosted: Thu Aug 01, 2002 12:29 pm    Post subject: Date conversion Reply with quote

Acolyte

Joined: 24 Jun 2001
Posts: 65

Hello all,
I am wondering if anyone has run into this problem. I have an application that sends the date field in this format:

MM/DD/YYYY HH:MM:SS

However, this date field is inserted into a Oracle table and Oracle will not accept a date in that format. Oracle will only accept it in this format:

DD-MMM-YY (i.e 04-JUL-02)

As I began my peliminary seach through the ESQL manual, I found that the month issue is easily solved with a CASE statement:

CASE Month
WHEN '01' THEN 'Jan'
WHEN '02' THEN 'Feb'
(and so on....)

I am a little lost on how I will remove the time and replace the '/' with '-' and will I "Copy Message Headers' or 'Copy Entire Message'.

Thanks!
Back to top
View user's profile Send private message
sgopal
PostPosted: Thu Aug 01, 2002 12:41 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Jul 2002
Posts: 63

jeasterl,

You can do a substring of the date field (MM/DD/YYYY HH:MM:SS) to get the month, day and year.

Convert MM to MMM as per your ESQL.

And form a string by concatenating as follows,
DD-field || '-' || MMM-field || '-' || YY field

Use the Copy Entire Message option if you need the message to be propagated ahead.
Back to top
View user's profile Send private message
Miriam Kaestner
PostPosted: Fri Aug 02, 2002 1:41 am    Post subject: Reply with quote

Centurion

Joined: 26 Jun 2001
Posts: 103
Location: IBM IT Education Services, Germany

If you are working with MRM messages, then you don't need to code the date conversion in ESQL. Just specify the custom date format as a string for the DATETIME element, e.g. 'DD-MMM-YY' in your case.
Back to top
View user's profile Send private message Send e-mail
mpuetz
PostPosted: Mon Aug 12, 2002 12:41 pm    Post subject: Reply with quote

Centurion

Joined: 05 Jul 2001
Posts: 149
Location: IBM/Central WebSphere Services

Hi,

if you work with Oracle there is another, maybe simpler solution:
Let Oracle do the conversion for you with PASSTHRU

PASSTHRU('INSERT (date) INTO mytable VALUES(to_date(?."oracle_format_string"))',InputBody.XML.blabla.mydate);

Instead of

INSERT ("date") INTO mytable VALUES (InputBody.XML.blabla.mydate);

where oracle_format_string describes the format of your date-string.
Simply look-up the to_date SQL Function in the Oracle documentation
_________________
Mathias Puetz

IBM/Central WebSphere Services
WebSphere Business Integration Specialist
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 » Date conversion
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.