Re: PreparedStatement error upon trying to set a '?' after interval keyword

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, javadesigner <javadesigner(at)yahoo(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PreparedStatement error upon trying to set a '?' after interval keyword
Date: 2014-08-12 04:02:56
Message-ID: 53E991F0.5000109@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 08/12/2014 04:34 AM, Sehrope Sarkuni wrote:
> AND checkin_time > (CURRENT_DATE - (? || ' days')::interval)

It's generally preferable to write

(? * INTERVAL '1' DAY)

instead.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sehrope Sarkuni 2014-08-12 12:22:14 Re: PreparedStatement error upon trying to set a '?' after interval keyword
Previous Message Sehrope Sarkuni 2014-08-11 20:34:29 Re: PreparedStatement error upon trying to set a '?' after interval keyword