Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XHBic-0001Oe-D5 for pgsql-jdbc@arkaria.postgresql.org; Tue, 12 Aug 2014 13:02:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XHBib-0003er-OW for pgsql-jdbc@arkaria.postgresql.org; Tue, 12 Aug 2014 13:02:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XHBia-0003ek-SE for pgsql-jdbc@postgresql.org; Tue, 12 Aug 2014 13:02:24 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XHBiT-00073N-76 for pgsql-jdbc@postgresql.org; Tue, 12 Aug 2014 13:02:23 +0000 Received: from ayaki.localdomain (106-68-152-49.dyn.iinet.net.au [106.68.152.49]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MgecZ-1X4s9j2FsN-00NxNm; Tue, 12 Aug 2014 15:02:14 +0200 Message-ID: <53EA1050.2060504@2ndquadrant.com> Date: Tue, 12 Aug 2014 21:02:08 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Sehrope Sarkuni CC: javadesigner , List Subject: Re: PreparedStatement error upon trying to set a '?' after interval keyword References: <53E9144B.4010404@yahoo.com> <53E991F0.5000109@2ndquadrant.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:c52/qdBObhZbFIcXOqu1G0lOjRjvCF9nr6WHJ9eTLAn tPzKP4Z4P/BSu6yQCEiBwQnLOVcVItKn67kZy1B+T+Mhe31Gcd lOWevzhCL8TgJnnlpl6fykf/XXeBEOMsT0F1COg23rDKQAF8Ma fEyRXH6wmuqPlzbm1+EY6tA0YFSDmeVucnw3zqMpIN5wURWk93 lfMFanWOzdOqfjmdouY6hfmK1iQ6obW7dyR7KLNiWAJbxt25bp HHT0oc87363gz/6w9eJGcUYTjjM2K8xgiMv8EhvXCh6NjZwF8D pQ1Wusopld9+50rXOC9M98iemGfBI1oCBfam/HA47hd7248oN7 eSmZb+mW4SM4NNuVeie9hmJwtL7TyfhUGIqKMOh9M X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On 08/12/2014 08:22 PM, Sehrope Sarkuni wrote: > I'd probably use the ::interval cast syntax though, so something like: > checkin_time > (CURRENT_DATE - (? * '1 day'::interval)) I only used INTERVAL '1' DAY because AFAIK that's the standard form. Given the miserable support for intervals in other RDBMSes, it doesn't matter much in practice. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc