Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Geetha Gubendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;)
 
Geetha Gubendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic