Bernice Bernice - 3 months ago 13
Java Question

What can SQL CODE -104 (error) represent?

I am executing an SQL query via jcc to run a report. When I opened the error log file for the program and examined the SQL query, everything seems to be fine (There are no extra or missing brackets, commas, etc and the syntax is good) however when I execute I am getting this error:

[Report.execute()] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=,;ATE IN (1,2,3,10,1)
;, DRIVER=4.12.55

When I researched about the SQLCODE I found out that it means there is an illegal symbol in the query. What can I look for to find this illegal symbol?

This is the query

enter image description here

Sorry for the tiny font but if you zoom 200% or so you can see the query better.

Thanks a lot :)

Answer

You have a comma (where you shouldn't) at the end of this line:

AND Tick.STATE IN (1,2,3,10,1),

The following line also has the same problem.