Hi team,
I am trying to execute an update customSQL but it's throwing error on IN clause. Because it's just trying to replace the passed data in query as it is. So it's syntax error for SQL.
I tried sending the id_list as arraylist and a comma separated string too. Is there any way of passing list inside IN clause in customSQL?
I am trying to execute an update customSQL but it's throwing error on IN clause. Because it's just trying to replace the passed data in query as it is. So it's syntax error for SQL.
Code:
<operationBindings>
<operationBinding operationType="update" operationId="applyToAll" allowMultiUpdate="true">
<customSQL>
UPDATE Test te
INNER JOIN
Test1 te1 ON te.id = te1.id
INNER JOIN
Test2 te2 ON te2.id= te1.id
SET
te.name= #if($values.name) $values.name#else te.name #end,
te.cost = CASE WHEN te2.customer_id > 0 OR (te2.customer_id < 0 and te2.name = "Admin")
THEN #if($values.cost) $values.cost#else te.cost#end
ELSE te.cost END
WHERE
te.idin ($values.id_list);
</customSQL>
</operationBinding>
</operationBindings>
Comment