ibatis with overlaps query

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: ibatis with overlaps query
Date: 2009-04-02 14:01:53
Message-ID: 49D4C551.3030702@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Good morning,

With ibatis, do overlap checking:

(1) select (DATE #begin_date#, DATE #end_date#) overlaps
(DATE '2008-01-01', DATE '2009-01-01')
. #begin_date# is varchar
. #end_date# is varchar

Always get:
============
Cause: java.sql.SQLException: ERROR: syntax error at or near "$4"

However, when I updated the query to
(2) select (#begin_date#::DATE, #end_date#::DATE) overlaps
(DATE '2008-01-01', DATE '2009-01-01')

It works. I am bit confused why (1) does not work, but (2) does?

--
Lu Ying

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tony Cebzanov 2009-04-02 14:22:50 Performance problem with row count trigger
Previous Message Alvaro Herrera 2009-04-02 13:54:04 Re: SQL to Check whether "AN HOUR PERIOD" is between start and end timestamps