ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brandon Goodin" <brandon.goo...@gmail.com>
Subject Re: compound conditions
Date Fri, 09 Jun 2006 03:57:36 GMT
I believe it is the result of the '/' character that you are using.
Try something like...

<isNotNull prepend="AND" property="endDate">
               opr_dt between #startDate# and ( #endDate# -
1<![CDATA[/]]>86400 )
</isNotNull>

On 6/8/06, Mike Jackson <minininja@gmail.com> wrote:
> I'm trying to build a select that uses a union of two sql statements
> both using the between operator in SQL to check for a date between two
> values.  I can't get it to work, I keep getting sax exception saying
> that I'm missing the end </dynamic> tag.  I've checked the whole file
> and I've got balanced tags, so I don't get it.  I'm attaching the
> XML/SQL and I'm hoping that someone can set me straight.
>
> <select id="maxAllocated"
> resultClass="com.caiso.irr.db.ibatis.DaoImpl$InlineFloat">
> select
>         max(value) as value
> from (
>         select
>                 max( somevalue ) as value
>         from
>                 table_1
> <dynamic prepend="WHERE">
> <isNotNull property="startDate">
> <isNotNull prepend="AND" property="endDate">
>                 opr_dt between #startDate# and ( #endDate# - 1/86400 )
> </isNotNull>
> </isNotNull>
> </dynamic>
>         union
>         select
>                 max( somevalue ) as value
>         from
>                 table_2
> <dynamic prepend="WHERE">
> <isNotNull property="startDate">
> <isNotNull prepend="AND" property="endDate">
>                 opr_dt between #startDate# and ( #endDate# - 1/86400 )
> </isNotNull>
> </isNotNull>
> </dynamic>
>         )
> </select>
>
> --mikej
> -=-----
> mike jackson
> minininja@gmail.com
>
> Character Density, n.:
>         The number of very weird people in the office.
>

Mime
View raw message