Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2012
    Posts
    3

    Unanswered: 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 03:33.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    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 ".

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    "–" may not be an equal("-")

  6. #6
    Join Date
    Jan 2012
    Posts
    3
    Yes column is Time stamp and version is 9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •