Needing Help for creating search bucket

Posts   
 
    
soheil
User
Posts: 2
Joined: 16-Jan-2007
# Posted on: 16-Jan-2007 12:29:15   

Hello

I'm trying to create a search bucket for the following script:

select * from p inner join q on p.ColumnID like convert(varchar(2), q.ColumnID ) +'%'

Problem here is I dont know how to create join condition with like operator! thanks!

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 16-Jan-2007 14:18:52   

use the percent symbol (modulo?) for a sort hand like opeator.


fitler.PredicateExpression.Add(myField.FieldName % "myValue" + "%");

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 16-Jan-2007 19:41:39   

To make a Join, you should add an define and use an EntityRelation (added to the relationPredicateBucket relations collection, if you are using a RelationPredicatebucket).

To have a filter beside the ON Clause, assign the filter to the CustomFilter property of the EntityRelation. If you want to use this filter instead of the ON Clause set the CustomFilterReplacesOnClause property to true.

soheil
User
Posts: 2
Joined: 16-Jan-2007
# Posted on: 17-Jan-2007 14:28:03   

I Used CustomFilter and CustomFilterReplacesOnClause property But problem is that I cant make a PredicateExpression To compare two Field of diffrentTables with Like operator!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 17-Jan-2007 16:20:39   

You can implement your own IExpression and use it instead: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3829