View Single Post

   
  #2 (permalink)  
Old 04-16-2008, 01:49 AM
Kris Jurka
 
Posts: n/a
Default Re: IN clause with PreparedStatement



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...6/msg00015.php

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Reply With Quote