1 Reply Latest reply on Aug 8, 2002 3:03 PM by Dain Sundstrom

    Dynamic WHERE clause

    Ryan Kinzy Newbie

      How do I create a dynamic WHERE clause for a finder method? I am trying to search a table based on one or more parameters that the user enters.

      So, the query might be where (Attribute=NAME AND Value LIKE 'x%') OR (Attribute=ID AND Value LIKE 'y%'). The Attribute/Value clauses are dynamic and determined by the user through a search interface.

      I can dynamically build the Attribute/Value WHERE clause programmatically, but how do I pass it into a finder method? Is this even the right approach?