I use in an IN-operator with 13 parameters in a select statement like this:
SELECT COUNT("COL1") FROM "TABLE1" WHERE "COL2" = ? AND "COL1" IN (?, ?, ?, ?
, ?, ?, ?, ?, ?, ?, ?, ?, ?)
on execution I get an error that there is a syntax error near the ','.
When I look with the SQL-profiler I see that the statement is translated
into the following (to get the result data types?):
sqljdbc_1.2.2828
SET FMTONLY ON SELECT "LISTENER_NAME_L", "EVENT_NAME_L", ,, ,, ,, ,, ,, ,, ,,
,, ,, ,, ,, , FROM "EVENT_LISTENER" SET FMTONLY OFF
or sqljdbc_2.0.1803
sp_executesql N'SET FMTONLY ON SELECT "LISTENER_NAME_L", "EVENT_NAME_L", ,, ,
, ,, ,, ,, ,, ,, ,, ,, ,, ,, , FROM "EVENT_LISTENER" WHERE 1 = 2'
which is obviously the reason for the syntax error.
But what can I doo to prevent this error?
The given select statement is simple SQL or?
Mike
The error appears only in conjunction with Apache commons-dbutils in version
1.3.
Solution is to set pmdKnownBroken to true. Like here:
QueryRunner x = new QueryRunner(dataSource, true);
Mike