EacapeString and Like search

Ruslan Zasukhin sunshine at public.kherson.ua
Sun May 28 23:06:01 CDT 2006


On 5/28/06 9:43 PM, "Erne" <ernestogiannotta at tiscalinet.it> wrote:

Hi Erne,

> making some test I want to find this text:
> 
>    a'\s
> 
> so I pass it to Valentina.EscapeString and I get:
> 
>    a\'\\s
> 
> seems correct to me but if I search
> 
>    Like '%a\'\\s%'
> 
> I get no match (seems wrong to me)

No, this is correct answer.

> so I input
> 
>    a'\\s
> 
> and pass it to Valentina.EscapeString and get:
> 
>    a\'\\\\s
> 
> again it's correct to me but when I do search:
> 
>    Like '%a\'\\\\s%'
> 
> I get match with a'\s (and again it seems wrong to me, I should get
> no match here)

Why you think it is wrong?

Let's think in next way. You have some function

    DoLike( str1, patternStr ) as boolean

You need use next pattern

    DoLike( "a'\s", "a'\\s" )   => true

Right?

In your case complexity comes that you need do 2 kinds of escape
    1) for Like itself
    2) for SQL parser.  >> this job to ValentinaEscape


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list