pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Ingmar Lötzsch <iloetzsch@asci-systemhaus.de>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: IN clause with PreparedStatement
Date: Wed, 18 Jul 2007 17:09:35 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0707181708370.14666@leary.csoft.net> (raw)
In-Reply-To: <469E34E6.3010002@asci-systemhaus.de>
References: <469E34E6.3010002@asci-systemhaus.de>



On Wed, 18 Jul 2007, Ingmar Lötzsch wrote:

> SELECT *
> FROM table1
> WHERE id IN (1, 2, 3);
>
> whereas the list 1, 2, 3 must be created dynamically. The goal is to
> avoid n queries for single objects instead of one query. I can
> concatenate the statement and use Statement. But I can't figure out, how
> to use PreperedStatement. Can you help me?
>

This identical thread concluded with a perl example that is relevant.

http://archives.postgresql.org/pgsql-jdbc/2007-06/msg00015.php

Kris Jurka



view thread (3+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0707181708370.14666@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0707181708370.14666@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0707181708370.14666@leary.csoft.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: books@ejurka.com, iloetzsch@asci-systemhaus.de
  Subject: Re: IN clause with PreparedStatement
  In-Reply-To: <Pine.BSO.4.64.0707181708370.14666@leary.csoft.net>
  References: <469E34E6.3010002@asci-systemhaus.de> <Pine.BSO.4.64.0707181708370.14666@leary.csoft.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