aspose file tools*
The moose likes JDBC and the fly likes Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: W Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: W" Watch "Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: W" New topic
Author

Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: W

Raj Shan
Ranch Hand

Joined: Sep 04, 2006
Posts: 65
I am trying to execute DELETE FROM (SELECT * FROM table WHERE DATE(column) > DATE(CURRENT_DATE - 60 DAYS) FETCH FIRST 10000 ROWS ONLY WITH UR). I am getting the below error. I am using db2 jcc jar file. Can someone provide me what exactly is causing this issue. It says some token or character or clause is issue.

Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: WITH;IRST 10000 ROWS ONLY;)
Raj Shan
Ranch Hand

Joined: Sep 04, 2006
Posts: 65
It got resolved. "with UR" should be for Delete. In the below query it was within select statement. The working query is "DELETE FROM (SELECT * FROM table WHERE DATE(column) > DATE(CURRENT_DATE - 60 DAYS) FETCH FIRST 10000 ROWS ONLY) WITH UR"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: W