ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DelGurth <delgu...@gmail.com>
Subject Re: Using #PARAM# constructions within $DYNAMICSQL$
Date Wed, 29 Apr 2009 08:13:43 GMT
On Wed, Apr 29, 2009 at 5:30 AM, Nathan Maves <nathan.maves@gmail.com> wrote:
> I have not tried this but I don't see why it would not work.
> SELECT * FROM person
>  WHERE person.lastname LIKE '%'||#lastname#||'%'
> the || is the concat operator for oracle.  it might be something else in
> another vendor

Probably you misunderstood my question. I'm not trying to get
#lastname# itself within my query.

$$ placeholders and ## placeholders are normally parsed by iBatis.$$
placeholders are just substituted with the value of the variable and
## placeholders are turned into bind variables. But if you put a ##
placeholder _within_ the value of a $$ placeholder, iBatis doesn't
parse the ## placeholder, so it doesn't substitute it for a bind

So I wish iBatis parsed the query twice, first to replace the $$
placeholders and then to replace the ## placeholders _including_ the
placeholders that where set within my $$ placeholder.

Hope I made it more clearly now.


View raw message