db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Vinca <micha...@vinca.org>
Subject Re: JDBC and WHERE IN clauses
Date Fri, 23 Sep 2005 19:02:40 GMT
Well, when you build the prepared statement, you could just loop and 
add "?, " to the string for the length of the array. Of course, at this 
point, you could just do a normal statement. But if you are 
programmatically filling in the prepared statement anyway, this could 
be a solution. Depends on what you are trying to do.

~Mike

On Sep 23, 2005, at 1:19 PM, Satheesh Bandaram wrote:

> Don't think you can do this in Derby. However, you can do:
>
> SELECT * FROM Names WHERE ID IN (?, ?, ?)
>
> and bind individual elements of the array to each of the parameters.
> This, of course, forces you to know the number of elements of the 
> array..
>
> Satheesh
>


Mime
View raw message