Hi,
I have a situation in which I need to apply a _tocompstring _function on all elements in the IN section.
ex SQL PSEUDO CODE:
select .....
from .....
WHERE x = 12
and y IN(
tocompstring ('BraVo'),
tocompstring ('MikE'),
tocompstring ('Yankee'),
......
)
I achieved a result using the following predicate:
filter.Add(A.X == someId);
IPredicateExpression tFilter = new PredicateExpression();
foreach (string c in col)
{
tFilter.AddWithOr(A.Y.SetExpression(new DbFunctionCall("someschema.tocompstring({0})", new object[] { A.Y})) ==
new DbFunctionCall("someschema.tocompstring({0})", new object[] { c}));
}
filter.AddWithAnd(tFilter);
which gaves me:
select .....
from .....
WHERE x = 12
and (y = tocompstring ('BraVo')
or y = tocompstring ('MikE')
or y = tocompstring ('Yankee')
......
)
How can I convert it into a query with 'IN' clausule?
Best Regards,
MiloszeS