Page 1 of 1

How to remove "ESCAPE '~'" from WHERE statement?

Posted: Tue 14 Apr 2015 10:57
by steffen_w
Hi,

this happens on MySQL, not sure about other databases.

Problem: Instead of creating a WHERE statement like this: "WHERE SomeColumn LIKE '%~test123%'" the following statement is created: "WHERE SomeColumn LIKE '%~test123%' ESCAPE '~'".

Question: How do I get rid of that "ESCAPE '~'" thing? In dotConnect there seems to be a property called NoEscapeLike but I can't find that in LinqConnect.

LinqConnect version is 8.3.283.0

Re: How to remove "ESCAPE '~'" from WHERE statement?

Posted: Wed 15 Apr 2015 09:18
by MariiaI
Thank you for the report on this. We will investigate this issue more clearly and inform you about the results as soon as any are available.
As a temporary workaround, you could try using this code:

Code: Select all

var query = from c in ctx.DEPTs where SqlMethods.Like(c.LOC,"%~test123%") select c;
in this case the generated SQL query will look like this:

Code: Select all

SELECT t1.DEPTNO, t1.DNAME, t1.LOC
FROM test_m.DEPTs t1
WHERE t1.LOC LIKE :p0
-- p0: Input VarChar (Size = 10; DbType = AnsiString) [%~test123%]
Please tell us if this helps.

Re: How to remove "ESCAPE '~'" from WHERE statement?

Posted: Wed 15 Apr 2015 14:55
by steffen_w
Yes, thank you. That did work!

Before I used IndexOf, which allowed me to specify wether I wanted the LIKE search to be case sensitive or not. Meaning, I'd appreciate it very much if it'd be fixed in a way that would allow me to go back to using IndexOf.

Anyway, hope you have a great day :)

Re: How to remove "ESCAPE '~'" from WHERE statement?

Posted: Tue 21 Apr 2015 09:36
by MariiaI
"WHERE SomeColumn LIKE '%~test123%' ESCAPE '~'".
We have fixed this issue. The fix will be included in the next public build of LinqConnect.
We will post here when it is released.

Re: How to remove "ESCAPE '~'" from WHERE statement?

Posted: Thu 23 Apr 2015 12:43
by MariiaI
New build of LinqConnect 4.4.735 is available!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=31666.