If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=426

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-19-12, 01:41
vasavshah vasavshah is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=426

I am trying to insert a record in the table using the following query

INSERT INTO XXXXX (ID,NUM,NUM,ST_CD, ID,TSTMP,TXT,ID) VALUES ('CID-00AB245',1,'820C53B','12','ENT01',(CURRENT TIMESTAMP–CURRENT TIMEZONE),'<Tag>This is the transaction XML.</Tag>','10e9d8da-f50f-4d81-b033-ad571d08a9a6')


com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=–;MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MINUTE HOURS, DRIVER=3.61.107


I m not able to find out the reason for failure. Pls help me out

Last edited by vasavshah; 01-19-12 at 02:33.
Reply With Quote
  #2 (permalink)  
Old 01-19-12, 02:13
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
not knowing the layout of the table this seems correct
try to put this statement in a local file and execute the insert locally...
see the error ..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 01-19-12, 02:18
vasavshah vasavshah is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
I did run the query on the local and found the following error..Please let me know if posting the table sturucture will help to resolve the issue


DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "–" was found following "". Expected tokens may
include: "( CONCAT || / MICROSECONDS MICROSECOND SECONDS SECOND MINUTES".
SQLSTATE=42601

SQL0104N An unexpected token "–" was found following "". Expected tokens may include: "( CONCAT || / MICROSECONDS MICROSECOND SECONDS SECOND MINUTES ".
Reply With Quote
  #4 (permalink)  
Old 01-19-12, 02:29
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
it seems to be related to CURRENT TIMESTAMP–CURRENT TIMEZONE
is this column a timestamp ?
I tried this and had no problem
db2 version ?
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #5 (permalink)  
Old 01-19-12, 02:31
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
"–" may not be an equal("-")
Reply With Quote
  #6 (permalink)  
Old 01-19-12, 02:35
vasavshah vasavshah is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
Yes column is Time stamp and version is 9
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On