You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Nathan Maves <Na...@Sun.COM> on 2004/12/06 21:08:19 UTC
Should this cause problems?
Here is the old sqlmap ...
<statement id="getPeriodsList" resultMap="periodsResult">
SELECT to_char(day_date,'YYYY MM (MON)') as stringValue,
min(trunc(day_date, 'MON')) as dateValue
FROM financial_dates
WHERE (trunc(Day_Date) >=
trunc(add_months(last_day(sysdate),- #value#))+1
AND trunc(Day_Date) <= trunc(add_months(sysdate,0)))
GROUP BY to_char(day_date,'YYYY MM (MON)')
ORDER BY 2
</statement>
When run, this above will hang.
DEBUG 12-06 10:41:22 {conn-100282} Connection
(ConnectionLogProxy.java:42)
DEBUG 12-06 10:41:22 {pstm-100283} PreparedStatement: SELECT
to_char(day_date,'YYYY MM (MON)') as stringValue,
min(trunc(day_date, 'MON')) as dateValue FROM financial_dates
WHERE (trunc(Day_Date) >= trunc(add_months(last_day(sysdate),-
?))+1 AND trunc(Day_Date) <= trunc(add_months(sysdate,0)))
GROUP BY to_char(day_date,'YYYY MM (MON)') ORDER BY 2
(PreparedStatementLogProxy.java:48)
DEBUG 12-06 10:41:22 {pstm-100283} Parameters: [12]
(PreparedStatementLogProxy.java:49)
DEBUG 12-06 10:41:22 {pstm-100283} Types: [java.lang.String]
(PreparedStatementLogProxy.java:50)
Nothing ever is returned.
We found that by removing the space after the minus sign "-#value#"
everything worked perfectly. This used to work for the last year and
just recently start failing.
We are using Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
nathan