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 » Unable to insert Broker's Current_Timestamp into DB2 table

Post new topic  Reply to topic
 Unable to insert Broker's Current_Timestamp into DB2 table « View previous topic :: View next topic » 
Author Message
SANTYP
PostPosted: Wed Dec 03, 2008 1:04 am    Post subject: Unable to insert Broker's Current_Timestamp into DB2 table Reply with quote

Centurion

Joined: 27 Mar 2007
Posts: 142

HI All,
I try to insert a broker's CURRENT_TIMESTAMP value to a DB2 table's TIMESTAMP type column, but it showing me the following error can any one help me out..


INSERT INTO ADDRESSDATES(
COREUPDATEDATETIME,
COREINSERTDATETIME,
UPDATEDBY,
INSERTEDBY,
VOSIREQUESTORID,
ADDRESSID,
ADDRESSDATEID)
VALUES( ?,?,?,?,?,?,?)
Insert
Type:INTEGER:2
Text:CHARACTER:-1
Insert
Type:INTEGER:5
Text:CHARACTER:[IBM][CLI Driver] CLI0102E Invalid conversion. SQLSTATE=07006
Insert
Type:INTEGER:5
Text:CHARACTER:07006
Insert
Type:INTEGER:2
Text:CHARACTER:-99999
Insert
Type:INTEGER:5
Text:CHARACTER:2000000058,1001001,2000000358,String,String,TIMESTAMP '2008-12-03 14:25:21.938060',TIMESTAMP '2008-12-03 14:25:21.938060'
Back to top
View user's profile Send private message
AkankshA
PostPosted: Wed Dec 03, 2008 1:10 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

CURRENT_TIMESTAMP returns you "TIMESTAMP '2008-12-03 14:25:21.938060'"

and DB2 expects only '2008-12-03 14:25:21.938060'"

substring or cast would be of help here...
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
SANTYP
PostPosted: Wed Dec 03, 2008 1:15 am    Post subject: Reply with quote

Centurion

Joined: 27 Mar 2007
Posts: 142

AkankshA wrote:
CURRENT_TIMESTAMP returns you "TIMESTAMP '2008-12-03 14:25:21.938060'"

and DB2 expects only '2008-12-03 14:25:21.938060'"

substring or cast would be of help here...


Hi Akanksha,
yes we can do this using substring function, but i tried in the following ways
CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'yyyy-MM-dd HH:mm:ss')
CAST(CURRENT_TIMESTAMP AS TIMESTAMP FORMAT 'yyyy-MM-dd HH:mm:ss') but it is showing same exception
Back to top
View user's profile Send private message
AkankshA
PostPosted: Wed Dec 03, 2008 1:53 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

refer

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05610_.htm
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Wed Dec 03, 2008 3:40 am    Post subject: Reply with quote

Grand High Poobah

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

And more specifically:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ak05616_.htm
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Dec 03, 2008 4:58 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hello.

Remember that the string:

Code:
TIMESTAMP '2008-12-03 14:25:21.938060'


Is effectively the "As String" representation of an ESQL timestamp. It is not stored like that internally, or given to DB2 in this format. As documented in topic ak05730, ESQL TIMESTAMP maps to DB2 TIMESTAMP which means you should be able to INSERT the data without a CAST. I noticed that your INSERT contains several VALUES. Can you try a simpler test to make sure the "CLI0102E Invalid conversion" was really being caused by the TIMESTAMP and not some other inserted value?

Also, looking at the partial ESQL in the error message below, it would appear that the TIMESTAMP columns are at the beginning, but the TIMSTAMP values are shown at the end of the values in the error message. This may just be the error message formatting, but are you sure you inserted the values in the right order?

If you still receive the error, can you post your DB2 version/fixpack WMB version/fixpack and the full ESQL you are using, along with the full error message.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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 » Unable to insert Broker's Current_Timestamp into DB2 table
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.