ORA-01795: maximum number of expressions in a list is 1000

StringBuffer sb = new StringBuffer();

List<Long> columnContents = new ArrayList<Long>();

for ( int i = 0; i < columnContents.size(); i++) {

if ((i % 10) == 0 && i > 0) {

sb.deleteCharAt(sb.length() - 1);

sb.append( ") OR " + "ID" + " IN ( '" + columnContents.get(i) + "'," );

// resolved ORA-01795 problem.

} else {

sb.append( "'" + columnContents.get(i) + "',");

}

}

// delete the last comma
sb.deleteCharAt(sb.length() - 1);
String selectSQL = "SELECT * FROM T_CUST_FOLLOWUP_LIST WHERE ID IN ( " + sb.toString() + " )";
System. out.println(selectSQL);