Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IN clause in PreparedStatement

843859Apr 23 2009 — edited Nov 20 2014
I have a SELECT statement :

"select A, B, C from SOME_TABLE where SOME_FIELD in ( ? )",

"?" could be (1,2,3) or (1,2,3,4,5) etc.

I tried to use "setArray" method however it doesn't work. The obvious workaround is to generate IN clause and to append it to the query. But I would rather use PreparedStatement standard approach. Is it possible?

thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 30 2010
Added on Apr 23 2009
9 comments
1,711 views