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 Odelya YomTov <od...@jpost.com> on 2009/07/24 11:39:05 UTC
Ibatis sql question
Hi!
I would like to get a parameter in my sql and by that to decide if to use
prepend="OR" or prepend="AND"
<isNotEqual prepend="<here to write the parameter of the query>"
property="maxprice"
compareValue="0">
price BETWEEN #price# AND #maxprice#
</isNotEqual>
How can I do it?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
RE: Ibatis sql question
Posted by Andrey Rogov <ko...@gmail.com>.
Sorry.
<isEqual prepend="and" property="maxprice" compareValue="1">
price BETWEEN #price# AND #maxprice#
</isEqual>
<isEqual prepend="and" property="maxprice" compareValue="0">
price =#price# OR price=#maxprice#
</isEqual>
_____
From: Sergey Livanov [mailto:sergey.livanov@gmail.com]
Sent: Friday, July 24, 2009 3:32 PM
To: user-java@ibatis.apache.org
Subject: Re: Ibatis sql question
<isNotEqual prepend="#parameter#" property="maxprice" compareValue="1">
price BETWEEN #price# AND #maxprice#
</isNotEqual>
<isNotEqual prepend="#parameter#" property="maxprice" compareValue="0">
price =#price# OR price=#maxprice#
</isNotEqual>
2009/7/24 Odelya YomTov <od...@jpost.com>
Hi!
I would like to get a parameter in my sql and by that to decide if to use
prepend="OR" or prepend="AND"
<isNotEqual prepend="<here to write the parameter of the query>"
property="maxprice"
compareValue="0">
price BETWEEN #price# AND #maxprice#
</isNotEqual>
How can I do it?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
RE: Ibatis sql question
Posted by Andrey Rogov <ko...@gmail.com>.
<isEqual prepend="#parameter#" property="maxprice" compareValue="0">
price =#price# OR price=#maxprice#
</isEqual>
<isEqual prepend="#parameter#" property="maxprice" compareValue="1">
price BETWEEN #price# AND #maxprice#
</isEqual>
That's better
_____
From: Sergey Livanov [mailto:sergey.livanov@gmail.com]
Sent: Friday, July 24, 2009 3:32 PM
To: user-java@ibatis.apache.org
Subject: Re: Ibatis sql question
<isNotEqual prepend="#parameter#" property="maxprice" compareValue="1">
price BETWEEN #price# AND #maxprice#
</isNotEqual>
<isNotEqual prepend="#parameter#" property="maxprice" compareValue="0">
price =#price# OR price=#maxprice#
</isNotEqual>
2009/7/24 Odelya YomTov <od...@jpost.com>
Hi!
I would like to get a parameter in my sql and by that to decide if to use
prepend="OR" or prepend="AND"
<isNotEqual prepend="<here to write the parameter of the query>"
property="maxprice"
compareValue="0">
price BETWEEN #price# AND #maxprice#
</isNotEqual>
How can I do it?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org
Re: Ibatis sql question
Posted by Sergey Livanov <se...@gmail.com>.
<isNotEqual prepend="#parameter#" property="maxprice" compareValue="1">
price BETWEEN #price# AND #maxprice#
</isNotEqual>
<isNotEqual prepend="#parameter#" property="maxprice" compareValue="0">
price =#price# OR price=#maxprice#
</isNotEqual>
2009/7/24 Odelya YomTov <od...@jpost.com>
> Hi!
>
> I would like to get a parameter in my sql and by that to decide if to use
> prepend="OR" or prepend="AND"
>
> <isNotEqual prepend="<here to write the parameter of the query>"
> property="maxprice"
> compareValue="0">
> price BETWEEN #price# AND #maxprice#
> </isNotEqual>
>
> How can I do it?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>