Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DD7E91337B43 for ; Tue, 5 Apr 2011 09:52:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 69092-09 for ; Tue, 5 Apr 2011 12:52:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from intern.proventis.net (intern.proventis.net [85.182.161.50]) by mail.postgresql.org (Postfix) with ESMTP id 42E8813364DE for ; Tue, 5 Apr 2011 09:52:25 -0300 (ADT) Received: from mail.proventis.net (unknown [192.168.22.239]) by intern.proventis.net (Postfix) with ESMTP id BD7D5E449; Tue, 5 Apr 2011 14:52:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.proventis.net (Postfix) with ESMTP id B3B77C3F65; Tue, 5 Apr 2011 14:52:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.proventis.net Received: from mail.proventis.net ([127.0.0.1]) by localhost (mail.proventis.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0FQrg4pq12fc; Tue, 5 Apr 2011 14:52:22 +0200 (CEST) Received: from [192.168.22.130] (tmarkus.proventis.net [192.168.22.130]) by mail.proventis.net (Postfix) with ESMTP id 47929C3F63; Tue, 5 Apr 2011 14:52:22 +0200 (CEST) Message-ID: <4D9B1086.6040302@proventis.net> Date: Tue, 05 Apr 2011 14:52:22 +0200 From: Thomas Markus Organization: proventis GmbH User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Lightning/1.0b2 Mnenhy/0.8.3 Thunderbird/3.1.8 MIME-Version: 1.0 To: Daron Ryan CC: pgsql-jdbc@postgresql.org Subject: Re: PreparedStatement for set membership (The IN operator) References: <4D9AC223.4000602@gmail.com> In-Reply-To: <4D9AC223.4000602@gmail.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/23 X-Sequence-Number: 21749 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. >