Subject | Re: [ib-support] LIKE problem |
---|---|
Author | Hans Hoogstraat |
Post date | 2003-04-09T05:38:58Z |
Just wanted to test it heLen :) Example nutty I know .. lol
----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <ib-support@yahoogroups.com>
Sent: Tuesday, April 08, 2003 11:33 PM
Subject: Re: [ib-support] LIKE problem
> At 10:12 PM 8/04/2003 -0600, you wrote:
> >Just puzzled ...
> >
> >select * from products where prodname like 'SUGARB' escape 'B' generates
an
> >'invalid escape sequence' error.
> >
> >Maybe the - escape 'B'- part not honored by IB_Wisql ?
>
> That's not how it works....the purpose of the ESCAPE sequence is to
> "escape" one of the wildcard characters ('%' or '_') so that you can
search
> for them as literals. Also, IMO, it doesn't make a whole lot of sense to
> use 'B' as an escape character, since it's pretty likely that it will show
> up in the data and mess things up. The examples use @, I'd go with that,
> or even good ol' '^'...as long as it's something that's not likely to be
in
> the literal part of the search string.
>
> But here's how that escaped thingy works:
>
> select * from products where prodname like 'SUGARB%%' escape 'B'
>
> so what actually happens here is that 'B' is treated as the escape marker
> for the following character in the search string ('%'), making that
> occurrence of '%' part of the literal. The second (non-escaped)
occurrence
> of '%' says "I'm looking for any string that starts with 'SUGAR%' - so it
> aint gonna find 'SUGARBABY'.
>
> heLen
>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>