Hello,
How can I go about using a PreparedStatement for a SQL query that uses the Oracle IN operator.
I have something like
SELECT name FROM emp WHERE id IN ('A11', 'B12', 'C13')
The number of values specified in the IN-list is only known at run time.
Is there any way of using a PreparedStatement other than calculate the number of values at run-time and create a String with that many '?'s, and set them individually, in which case I might as well use a Statement, since the values to be put into IN-list are retrieved directly from the database, and will be genuine String values.
Cheers
Sonny
How can I go about using a PreparedStatement for a SQL query that uses the Oracle IN operator.
I have something like
SELECT name FROM emp WHERE id IN ('A11', 'B12', 'C13')
The number of values specified in the IN-list is only known at run time.
Is there any way of using a PreparedStatement other than calculate the number of values at run-time and create a String with that many '?'s, and set them individually, in which case I might as well use a Statement, since the values to be put into IN-list are retrieved directly from the database, and will be genuine String values.
Cheers
Sonny