PreparedStatement for set membership (The IN operator)

From: Daron Ryan <daron(dot)ryan(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: PreparedStatement for set membership (The IN operator)
Date: 2011-04-05 07:17:55
Message-ID: 4D9AC223.4000602@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2011-04-05 08:27:48 Re: PreparedStatement for set membership (The IN operator)
Previous Message Oliver Jowett 2011-04-04 22:28:05 Re: [pgsql-jdbc] Daily digest v1.2821 (7 messages)