views:

212

answers:

1

I am running into similar situation as this post. My pseudo code is

string hql = "select ai from AreaInfo as ai where ai.PhoneSegment is substring of :InputPhoneNumber";

Using like wouldn't do the trick because what Like is doing is

string hql = "select ai from AreaInfo as ai where :InputPhoneNumber is substring of ai.PhoneSegment";

So, what is the correct syntax to perform this task? My environment is Castle ActiveRecord on top of NHibernate. Thanks in advance.

A: 

Hello. I believe you're trying to do something like this:

select ai from AreaInfo ai where :InputPhoneNumber like concat('%', ai.PhoneSegment)

Is that it?

Danilo Moret