Team IBatis,
 
i am a newbee in ibatis framework and i want to use ibatis framework on a .net project. i would like to know how can i have a dynamic call of select queries with varying number of where conditions. I am using this query for searching that can require varying number of where criterias such as CustomerID, LastName, FirstName and City. User can fill up all criterias but the can leave it blank to, so there will be a dynamic where clause. Currently this is my code. How can i  write a where clause that can have dynamic fields? Also there would be a problem with the insertion of AND/OR Clause

<select id="SelectCustFilterByName" resultMap="SelectResult" parameterClass="Customer">
 SELECT CustomerID, LastName FROM Customers
 <dynamic prepend="WHERE">
  <isParameterPresent>
   LastName LIKE #value#
  </isParameterPresent>
 </dynamic>
   
</select> 
 
 
thanks in advance
Roy
 


Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.

Reply via email to