Re: PreparedStatement for set membership (The IN operator)

From: Thomas Markus <t(dot)markus(at)proventis(dot)net>
To: Daron Ryan <daron(dot)ryan(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PreparedStatement for set membership (The IN operator)
Date: 2011-04-05 12:52:22
Message-ID: 4D9B1086.6040302@proventis.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

hi,

try

select unnest(ARRAY[?,?,?])

regards
Thomas

Am 05.04.2011 09:17, schrieb Daron Ryan:
> Hello,
>
> I need to use a SELECT statement with varying data for set membership.
> IE.
>
> SELECT link_id
> FROM links
> WHERE heading_id IN (?, ?, ?)
>
> It won't always be the same number of members in the set. I am using
> an ordinary statement with an executeQuery call but would prefer to
> use a PreparedStatement. Is this possible? If so how do I set the
> values in the set?
>
> Regards,
> Daron.
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2011-04-05 12:56:36 Re: PreparedStatement for set membership (The IN operator)
Previous Message Daron Ryan 2011-04-05 12:39:08 Re: PreparedStatement for set membership (The IN operator)