I also found this works:

where in (select * from table(foo int = (?)))

I recall that there are performance differences between 'in' clauses and 
joins against table literals, though in practice I'm unable to predict 
which will be best w/o testing with real data: it can go either way.

On Sunday, June 14, 2015 at 11:40:54 AM UTC-7, Sergi Vladykin wrote:
>
> Currently this is not supported directly, though you can use TABLE 
> function ( http://www.h2database.com/html/functions.html#table ) to 
> workaround this issue and write queries like this
>
> select t.* from my_table t, table(id int = ?) z where t.id =  z.id
>
> and pass the array as parameter.
>
> But this question raises up often and I believe we can fix this relatively 
> easy by allowing `IN ?` expression where parameter is expected to be an 
> array. Thoughts?
>
> Sergi
>
>
>
> 2015-06-14 19:55 GMT+03:00 Brian Craft <[email protected] <javascript:>>:
>
>> Is there a way to parameterize the values in WHERE ... IN? Like "IN (?)". 
>> I'm trying this, passing in an array of String, [Ljava.lang.String, but it 
>> returns zero rows. Also tried passing [Ljava.lang.Object, with the same 
>> result.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to