You do it the same way you would with a prepared statement with JDBC directly. Since iBATIS uses PreparedStatement under the covers, you end up with this:
select * from foo where blah like ? The only way to make that work is to: A) change the parameter to be "x%" or B) change the statement to: select * from foo where blah like 'x%' You could use the $value$ syntax if you wanted to, but beware of the usual caveats re: SQL injection. Larry >>> [EMAIL PROTECTED] 01/01/05 12:34 PM >>> try something of the likes of: Select * from users_table where user_first_name like #M# + '%' This will vary depending on which database you use. But the only variance is the concatenation syntax, Brandon On Wed, 29 Dec 2004 10:04:26 -0500, Ramon Misho <[EMAIL PROTECTED]> wrote: > > > > Hello IBATIS Support > > In my XML file, I need to use a combination of #value#, like and '%'. > For example, if I want all information about users whose first names start > with a specific letter > > (say M), I could write the following statement: > > Select * from users_table where user_first_name like 'M%' > > > > However, if the letter is stored in #value# then I might consider writing > the following statement (which is NOT working) > > Select * from users_table where user_first_name like '#value#%' > > > > My question is: How does IBATIS handle this situation and how do I make > such Select statement work? > > > > > > Thanks a lot. > > > > > > > > Ramon Misho > > System Analyst / Programmer > > Mapping Development > > > > Teranet Inc. > > 655 Bay Street, Suite 600 > > Toronto, ON M5G 2K4 > > > > Phone 416.326.1322 ext 4150 > > Fax 416.314.6140 > > e-mail: [EMAIL PROTECTED] > > Website: http://www.teranet.ca/ > > > > The information in this e-mail is confidential and may be legally > privileged. It is intended solely for the addressee. Access to this e-mail > by anyone else is unauthorized. If you are not the intended recipient, any > disclosure, copying, distribution or any action taken or omitted to be taken > in reliance on it, is prohibited and may be unlawful. > >

