|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Unable to insert Broker's Current_Timestamp into DB2 table |
« View previous topic :: View next topic » |
Author |
Message
|
SANTYP |
Posted: Wed Dec 03, 2008 1:04 am Post subject: Unable to insert Broker's Current_Timestamp into DB2 table |
|
|
 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 |
|
 |
AkankshA |
Posted: Wed Dec 03, 2008 1:10 am Post subject: |
|
|
 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 |
|
 |
SANTYP |
Posted: Wed Dec 03, 2008 1:15 am Post subject: |
|
|
 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 |
|
 |
AkankshA |
Posted: Wed Dec 03, 2008 1:53 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 03, 2008 3:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
|
Back to top |
|
 |
mgk |
Posted: Wed Dec 03, 2008 4:58 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|