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>
Cc: javadesigner <javadesigner(at)yahoo(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PreparedStatement error upon trying to set a '?' after interval keyword
Date: 2014-08-12 13:02:08
Message-ID: 53EA1050.2060504@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Bell 2014-08-14 20:20:08 [ODBC] BIRT report opening multiple connections
Previous Message Sehrope Sarkuni 2014-08-12 12:22:14 Re: PreparedStatement error upon trying to set a '?' after interval keyword