Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0B95D64FCBB for ; Tue, 22 Jul 2008 03:55:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 31078-06 for ; Tue, 22 Jul 2008 03:54:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ikoffice.de (ikoffice.de [81.169.166.92]) by postgresql.org (Postfix) with ESMTP id A398A64FCB9 for ; Tue, 22 Jul 2008 03:54:55 -0300 (ADT) Received: from p5481ce55.dip.t-dialin.net ([84.129.206.85] helo=[192.168.1.16]) by ikoffice.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.66) (envelope-from ) id 1KLBlp-000731-RG; Tue, 22 Jul 2008 08:54:50 +0200 Message-ID: <48858439.3020101@ikoffice.de> Date: Tue, 22 Jul 2008 08:54:49 +0200 From: Daniel Migowski User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Arun ViswanathanChandrika CC: pgsql-jdbc@postgresql.org Subject: Re: issue with select IN (?) query References: <4ADAE57BEACCF2489D5871A8B883F9DD16EE27@TRVMSG.ustr.com> In-Reply-To: <4ADAE57BEACCF2489D5871A8B883F9DD16EE27@TRVMSG.ustr.com> Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Bar: - X-Spam-Score-Int: -17 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.673 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.672 X-Spam-Level: * X-Archive-Number: 200807/48 X-Sequence-Number: 18833 Hello Arun,

Arun ViswanathanChandrika schrieb:



        pm = con.prepareStatement("SELECT EMP_NAME FROM EMP where EMP_ID IN (?) ");
        pm.setString(1, "2,5,7");        //created many employees and id with 2, 5 and 7

Resolves to: SELECT EMP_NAME FROM EMP where EMP_ID IN ('2,5,7');

Watch the "'"'s :)

With best regards,
Daniel Migowski