pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Markus <t.markus@proventis.net>
To: Daron Ryan <daron.ryan@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: PreparedStatement for set membership (The IN operator)
Date: Tue, 05 Apr 2011 14:52:22 +0200
Message-ID: <4D9B1086.6040302@proventis.net> (raw)
In-Reply-To: <4D9AC223.4000602@gmail.com>
References: <4D9AC223.4000602@gmail.com>

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.
>





view thread (6+ messages)  latest in thread

Message-ID: <4D9B1086.6040302@proventis.net>
Permalink:  ../4D9B1086.6040302@proventis.net/
Also on:    postgresql.org/message-id/4D9B1086.6040302@proventis.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: t.markus@proventis.net, daron.ryan@gmail.com
  Subject: Re: PreparedStatement for set membership (The IN operator)
  In-Reply-To: <4D9B1086.6040302@proventis.net>
  References: <4D9AC223.4000602@gmail.com> <4D9B1086.6040302@proventis.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox