db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: JDBC and WHERE IN clauses
Date Fri, 23 Sep 2005 17:19:21 GMT
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

Tony Seebregts wrote:

> Hi,
>
> Does anybody know of a way to use a PreparedStatement with a WHERE IN
> (?) clause
>
> e.g. SELECT * FROM Names WHERE ID IN (?)
>
> where the parameter is replaced by an array of e.g. int's ?
>
> regards
>
> Tony Seebregts
>
>
>
>

Mime
View raw message