Although the question is old, I explain the way in which I solved it in my case.
The example is in Vb.NET but I think it is equally understood.
The solution, in general lines, was to convert the IN statement into a series of OR conditions with their respective parameters, all by program.
Starting from having a string with the searched values, separated by commas, WITHOUT the string quotes that Oracle would use and assuming that you have a defined OracleCommand, which I called oraCommando in the example.
What I did was assemble the query string by splitting the string that has the searched values, creating as many OR comparisons as necessary and assigning them value with their respective parameters.
Special attention should be paid in assigning the name of the parameter in the query string assembly so as not to leave spaces between the name and the number that is put at the end so that they are all different names.
strCommand & = " UserName = :userName" & puntParam & " "
The example code would be:
dim param as string = "Ben, Sam"
dim strCommand as string = "SELECT * FROM TableName WHERE"
dim puntParam as integer = 0
for each paramAnali as string in split (param, ",")
puntParam + = 1
if puntParam> 1 then
strCommand & = "or"
end if
strCommand & = "UserName =: userName" & puntParam.ToString () & ""
Dim paramNew As New OracleParameter With {
.ParameterName = "userName" & puntParam.ToString (),
.OracleDbType = OracleDbType.Varchar2,
.Direction = ParameterDirection.Input,
.Value = Trim (paramAnali)}
oraCommando.Parameters.Add (paramNew)
next
Also, in order not to have problems with the binding of the parameters, the Oracle command must be instructed to do the "bindery" by names.
oraCommando.BindByName = True
In this way, the query automatically adjusts to the number of values received without the need to adjust the code.