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 ESQL Current_Timestamp into DB2 table

Post new topic  Reply to topic
 Unable to insert ESQL Current_Timestamp into DB2 table « View previous topic :: View next topic » 
Author Message
madhu36r
PostPosted: Mon Jul 01, 2013 7:55 am    Post subject: Unable to insert ESQL Current_Timestamp into DB2 table Reply with quote

Newbie

Joined: 28 Nov 2006
Posts: 5

Hi All,

I am working with WMB6.1 on mainframe.

I am unable to insert ESQL CURRENT_TIMESTAMP into CURRENT TIMESTAMP of DB2 table.

I tried to map ESQL TIMESTAMP to DB2 Time stamp.
DECLARE myst CHARACTER 'SELECT CURRENT TIMESTAMP from SYSIBM.SYSDUMMY1 WITH UR';
SET Environment.Variables.myCurrTsp[1] = PASSTHRU(myst);
SET TEST_TS1 = CAST( Environment.Variables.myCurrTsp[1].*[1] AS TIMESTAMP);

I am getting the following exception. Please help me:

Text:CHARACTER:{DB2 FOR OS/390}{ODBC DRIVER}{DSN09015} … DSNT408I SQLCODE = -180, ERROR: THE DATE, TIME, OR TIMESTAMP VALUE *N IS … INVALID … DSNT418I SQLSTATE = 22007 SQLSTATE RETURN CODE … DSNT415I SQLERRP = DSNXRIHB SQL PROCEDURE DETECTING ERROR … DSNT416I SQLERRD = -6805 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION … DSNT416I SQLERRD = X'FFFFE56B' X'00000000' X'00000000' X'FFFFFFFF' … X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION … ERRLOC=1:13:2
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jul 01, 2013 8:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Remove the CAST.
Back to top
View user's profile Send private message
madhu36r
PostPosted: Mon Jul 01, 2013 8:24 am    Post subject: Reply with quote

Newbie

Joined: 28 Nov 2006
Posts: 5

Removed the CAST, still got the same exception


SET TEST_TS1 = Environment.Variables.myCurrTsp[1].*[1] ;


Text:CHARACTER:{DB2 FOR OS/390}{ODBC DRIVER}{DSN09015} … DSNT408I SQLCODE = -180, ERROR: THE DATE, TIME, OR TIMESTAMP VALUE *N IS … INVALID … DSNT418I SQLSTATE = 22007 SQLSTATE RETURN CODE … DSNT415I SQLERRP = DSNXRIHB SQL PROCEDURE DETECTING ERROR … DSNT416I SQLERRD = -6805 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION … DSNT416I SQLERRD = X'FFFFE56B' X'00000000' X'00000000' X'FFFFFFFF' … X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION … ERRLOC=1:13:2
Back to top
View user's profile Send private message
madhu36r
PostPosted: Mon Jul 01, 2013 11:06 am    Post subject: [SOLVED] ESQL TIMESTAMP is compatible with DB2 Reply with quote

Newbie

Joined: 28 Nov 2006
Posts: 5

HI ALL,

I have a typo in the character representation of a TIMESTAMP value of a column, so I am getting the above exception.

You dod not need to CAST to any character or timestamp.

The ESQL TIMESTAMP is compatible with DB2 CURRENT TIMESTAMP.

I directly passed CURRENT_TIMESTAMP.

Thanks for your support.
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 ESQL 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.