Groups > Interbase > Interbase SQL > Re: Ignoring spaces in a comparison




Re: Ignoring spaces in a comparison

Re: Ignoring spaces in a comparison
19 Mar 2008 08:55:50 -0700
If the spaces are embedded within the string there is no way to do what
you want except to write a UDF that performs the comparison.

-- 
Post Reply
Re: Ignoring spaces in a comparison
Wed, 19 Mar 2008 11:41:26 -040
"Russell" <russell@removethis.smxi.com> wrote in message 
news:47e102ef@newsgroups.borland.com...
> is there a simple way of ignoring spaces in a select, sort of
>
> WHERE IgnoreSpaces("MYFIELD") = 'MYVALUE'
>
> or is there a simple LIKE pattern that will achieve this effect? Not 
> really worried about performance on this one.


If the spaces are strictly leading and/or trailing, then you will find the 
value with:

    WHERE "MYFIELD" LIKE '%MYVALUE%'

-- 
Wayne Niddery - TeamB (www.teamb.com)
Winwright, Inc. (www.winwright.ca) 
Post Reply
Ignoring spaces in a comparison
Wed, 19 Mar 2008 12:11:27 -000
is there a simple way of ignoring spaces in a select, sort of

WHERE IgnoreSpaces("MYFIELD") = 'MYVALUE'

or is there a simple LIKE pattern that will achieve this effect? Not really 
worried about performance on this one.

many thanks 
Post Reply
Re: Ignoring spaces in a comparison
Thu, 20 Mar 2008 10:05:22 -000
Thanks, both of you. It is pretty musch as I expected, but hoped wasn't the 
case.

The alternative was to create a pretty heavy pattern from the value, but 
guess I will put the effort into updating the database and program to add 
some additional fields (actually a separate table) for creating the indexing 
strings.

"Bill Todd [TeamB]" <no@no.com> wrote in message 
news:47e13786@newsgroups.borland.com...
> If the spaces are embedded within the string there is no way to do what
> you want except to write a UDF that performs the comparison.
>
> -- 
> Bill Todd (TeamB) 
Post Reply
about | contact