jdbc CustomSQL - in operator

Is it possible to perform a multi-row delete using the ‘in’ operator over CustomSQL in the JDBC adapter? (Oracle db)

I tried the following steps

Sql:
DELETE FROM Table1 WHERE Col1 IN ( ? )

Input for Adapter:
VARCHAR, java.lang.String, col_in

When running, set col_in to
‘1002’, ‘1004’

No records were deleted.

When i set col_in to just 1004, without any quotes, the delete succeeded. Is there a way to concatenate and pass a list of values to the the in clause of a delete statement?

Thanks for your help,
Sunil

did you ever receive any replies? I’m trying to implement an ‘in’ condition as well on a select. thanks!

Use DynamicSQL Adapter template and pass the IN clause dynamically. I don’t think it is possible with CustommSQL. Any reason why you want to go with it?

Hi Sunil,

I have tried doing the same thing, but it wont work. Because “?” is a variable value you are passing, that may not take special chars. As senthil said, easy way is via Dynamic SQL (DELETE FROM Table1 WHERE Col1 IN ( ${columnVar})).

But be aware of limits of “IN” clause.

-Cheers,
Niteesh

Yes with CustomSQL question mark argument is the problem and so DynamicSQL passing argument is the option to go with as noted above:

HTH,
RMG