SIMILAR TO pattern matching
SIMILAR TO pattern matching
Is there be support in Linq to PostgreSQL for their SIMILAR TO pattern matching operator?
Re: SIMILAR TO pattern matching
You could use SqlMethods.Like method, which is translated into SQL command 'LIKE'. The 'SIMILAR TO' operator is not supported, because there are no methods, that could be translated into it. Thus, if you are using any complex regular expressions, you can only write commands manually and perform them via the ExecuteQuery() method (http://www.devart.com/linqconnect/docs/ ... Query.html).
Example of using SqlMethods.Like:
Please tell us if this helps.
Example of using SqlMethods.Like:
Code: Select all
YourDataContext context = new YourDataContext();
var query = from c in context.Depts where Devart.Data.Linq.SqlMethods.Like(c.Dname, "SALES") select c;
Re: SIMILAR TO pattern matching
Thanks for your reply. I will use the ExecuteQuery method.