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 » Milliseconds getting dropped when calling Oracle Stored Proc

Post new topic  Reply to topic
 Milliseconds getting dropped when calling Oracle Stored Proc « View previous topic :: View next topic » 
Author Message
dilse
PostPosted: Tue Dec 04, 2012 1:02 pm    Post subject: Milliseconds getting dropped when calling Oracle Stored Proc Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

Hi there..
Broker version:8.0.0.1

I am trying to call a Stored procedure using ESQL. One of the input parameters is the TIMESTAMP and it is defined as TIMESTAMP(6) in Oracle table as well. When I took the trace, it showing that the TIMESTAMP field was being sent properly with the value being shown as following in the trace.
Code:
''TIMESTAMP '2012-01-15 12:34:04.134'''


But when the SP is called and updated the table, it is missing the milliseconds details. The stored procedure also has some OUT parameters so I cannot use PASSTHRU statement. But based on the documentation the ESQL TIMESTAMP can only be a DATE in Oracle.

How do I update the table with having milliseconds.

Any ideas are appreciated!!!
_________________
DilSe..

Take life as it comes..
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Dec 04, 2012 1:09 pm    Post subject: Reply with quote

Jedi Knight

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

Add a separate INTEGER parameter for millis.
_________________
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
kash3338
PostPosted: Tue Dec 04, 2012 6:39 pm    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

The TIMESTAMP data type in Oracle stores only the year, month, and day of the DATE data type, plus hour, minute, and second values.

I guess it does not hold the milliseconds details in it.
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Wed Dec 05, 2012 12:41 am    Post subject: Re: Milliseconds getting dropped when calling Oracle Stored Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

dilse wrote:
But based on the documentation the ESQL TIMESTAMP can only be a DATE in Oracle.

The Oracle DATE datatype only supports integer values for year, month, day, hour, minute, and second, so it's not possible to preserve the milliseconds when converting:
ESQL TIMESTAMP --> Oracle DATE --> Oracle TIMESTAMP.

dilse wrote:
How do I update the table with having milliseconds.

Don't pass an ESQL TIMESTAMP to the stored procedure. Try converting it to ESQL CHARACTER first, and pass that instead. The stored procedure can then either implicitly or explicitly convert from one of the Oracle character datatypes to Oracle TIMESTAMP.
Back to top
View user's profile Send private message
dilse
PostPosted: Wed Dec 05, 2012 12:26 pm    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

Thanks for all your inputs.

Quote:
The TIMESTAMP data type in Oracle stores only the year, month, and day of the DATE data type, plus hour, minute, and second values.


Thats incorrect. Oracle TIMESTAMP can hold the date, time including micro seconds.

Quote:

Don't pass an ESQL TIMESTAMP to the stored procedure. Try converting it to ESQL CHARACTER first, and pass that instead. The stored procedure can then either implicitly or explicitly convert from one of the Oracle character datatypes to Oracle TIMESTAMP.


Thanks I tried this but it was throwing an error as the value that the SP expecting is TIMESTAMP.

Instead I had requested the DBA to change the parameter to change the field from TIMESTAMP to CHAR on the SP signature to workaround the issue and later they will convert it to a TIMESTAMP when updating a table. This as you all know works but I was trying to see if we can do it without doing this.

Again appreciate all your inputs!!
_________________
DilSe..

Take life as it comes..
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 » Milliseconds getting dropped when calling Oracle Stored Proc
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.