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 dropping milliseconds

Post new topic  Reply to topic
 TIMESTAMP dropping milliseconds « View previous topic :: View next topic » 
Author Message
mc01285
PostPosted: Fri Oct 01, 2010 12:48 pm    Post subject: TIMESTAMP dropping milliseconds Reply with quote

Novice

Joined: 11 May 2009
Posts: 11

I have an incoming field defined as xsd:dateTime and I need to pass it to an Oracle Stored Procedure as a TIMESTAMP.

The date coming in looks like 2010-10-01T11:10:08.304-04:00

I have tried various CAST's to get to what looks like the correct format in the debugger. My TIMESTAMP variable in the debugger looks like 2010-10-01 11:10:08.304

On the Oracle side the TIMESTAMP field is missing the milliseconds.

Any ideas?

Thanks for the help!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Oct 01, 2010 12:51 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What is the definition of the field on the ORACLE side? Is it sufficient to contain milliseconds? Is it sufficient to contain 3 digits of precision in milliseconds?

What does the InfoCenter say on the conversion of TIMESTAMP data between ESQL and Oracle?
Back to top
View user's profile Send private message
mc01285
PostPosted: Fri Oct 01, 2010 12:55 pm    Post subject: Reply with quote

Novice

Joined: 11 May 2009
Posts: 11

The Oracle field is defined as TIMESTAMP(6).
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sat Oct 02, 2010 1:10 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

I've seen this happen where there are no milliseconds in the value.
i.e.
17:24:35.000

you get
17.24.35 returned.

btw, this is also true if you are using the MQMD.PutTime and casting it to a char. You have to do a test to see if the length includes milliseconds. If not then you have to add them otherwise you can append it to the MQMD.PutDate and insert it into a db as a timestamp. Non the most elegant solution but one that has caused some problems in the past.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Oct 04, 2010 7:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

BTW - this is not a Message Broker issue, it is an Oracle issue. You may find better help in an Oracle support group.

Mods may like to lock this thread since it does not apply to Message Broker.

Oracle does not store millisecond granularity directly but it does store seconds with a fraction component which can help you to get the milliseconds. Timestamp precision default is platform dependent, on UNIX it defaults to 6 and on windows it defaults to 3. The valid range is [0-9].

The oracle.jbo.domain.Timestamp class accepts dates and times in the same format accepted by java.sql.TimeStamp (either a long milliseconds time value or the year, month, day, hour, minute, second, nano format) and java.sql.Timestamp (either a milliseconds time value or the year, month, day format).

On your select from table SQL statement, always use two FF's, regardless of the number of decimal digits you wish to see or use. 'FF' stands for the fractional seconds.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Mon Oct 04, 2010 7:47 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Two other notes:

1.
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05730_.htm

An ESQL datatype of TIMESTAMP, if used directly, converts to Oracle DATE datatype. To be able to use Oracle's TIMESTAMP datatype in ESQL, you need to use a PASSTHRU statement thusly:

Code:

SET OutputRoot.XML.Result.Data[] =
    PASSTHRU('SELECT * FROM user1.yourtable
    where time=TIMESTAMP(CAST(? as TIMESTAMP)),'1999-12-31-23.59.59.999999');



2.
Oracle 8 does not officially support sub-second granularity. Support for sub-second granularity changes with each version of 9i, 10i, and 11i.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » TIMESTAMP dropping milliseconds
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.