On Tuesday, January 26, 2016 at 3:37:06 PM UTC-8, Prabakaran wrote:
>
> Is it possible to pass an array for the IN clause in prepared statment?
>

Not generally.  However, in PostgreSQL "a IN (1,2,3)" is the same as "a = 
ANY('{1,2,3}'::integer[])".  So on PostgreSQL you can do:

DB.extension :pg_array
DB[:table].where{{:column=>any(:$array)}}.prepare(:all, 
:table_all).call(:array=>Sequel.pg_array([1,2,3]))

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to