Unable to append string arrays with SQL in operator dynamically. If more values are passed to the array dynamically, how to append it within operator in Oracle SQL query?
String[] rsIdArr = dObj.getRsId().split(",");
int length = rsIdArr.length;
for(int k=0; k<length; k++){
String appendArr[] = new String[k];
appendArr[k] = "'"+rsIdArr[k]+"'" ;
if(ValidationUtil.isValid(dObj.getRsId())){
strQuery = strQuery.append("AND TAppr.RS_ID IN " + appendArr[k] );
}
}
Expected result:
AND tappr.rs_id IN ('W0079', 'F002', 'P002159', 'D0701', ........)