pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daron Ryan <daron.ryan@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: PreparedStatement for set membership (The IN operator)
Date: Tue, 05 Apr 2011 16:47:55 +0930
Message-ID: <4D9AC223.4000602@gmail.com> (raw)

  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: <4D9AC223.4000602@gmail.com>
Permalink:  ../4D9AC223.4000602@gmail.com/
Also on:    postgresql.org/message-id/4D9AC223.4000602@gmail.com

 · 

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: daron.ryan@gmail.com
  Subject: Re: PreparedStatement for set membership (The IN operator)
  In-Reply-To: <4D9AC223.4000602@gmail.com>
  References: <4D9AC223.4000602@gmail.com>

* 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