The default limitation of Oracle ‘IN’ clause is 1000 elements (‘1’,’2’,’-‘,’1000’) but wha happens if you have 1005 elements. There are 2 ways one is configuring Oracle if you happen to have right permissions and DBAs are nice to you. But if that is not the case you can fall back on 2nd option as shown below.
For example this is what you have in Ibatis XML
< select id="getProductGroup" resultmap="result" parameterclass="java.lang.String">
---1005 comma separated strings (elements)
select * from table where xxx in #value#
</select>
The above works fine as long as you have 1000 comma separated strings but if you have more than 1000, you can replace it with the following.
< select id=" getProductGroup " resultmap="result" parameterclass="java.util.List">
--List containing comma separated strings
select * from table where
(
(instr (#[]# , ','||xxx||',') > 0)
)
< /select>
Of course, you will have to write utility class to create the parameter List.