Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Parameterizing queries with SQL "IN" clauses
I have query that I am calling using JDBC. The query has an "IN" clause in it:
select *
from table1 where id in (123,234,234,234);
I would like to be able to pass the values in the "IN" clause via a parameter, such as:
select *
from table1 where id in (?);
Then in my JDBC code I would have:
preparedStatement.setString(1, "123,234,234,234" );
This doesn't work, which doesn't surprise me. But does anybody know a way to do this, or do I have to build my IN clause in code?
Thanks Received on Thu Oct 19 2000 - 19:54:59 CDT