Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

multi-white space pattern search

5 posts in General Discussion Last posting was on 2003-10-17 16:06:26.0Z
Mousa Shaya Posted on 2003-10-09 19:08:56.0Z
From: "Mousa Shaya" <NOSPAM_Mousa.Shaya@nokia.com>
Newsgroups: ianywhere.public.general
Subject: multi-white space pattern search
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Original-NNTP-Posting-Host: esnat01x.nokia.com
Message-ID: <3f85b316@forums-2-dub>
X-Original-Trace: 9 Oct 2003 12:12:22 -0700, esnat01x.nokia.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Oct 2003 12:03:16 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Oct 2003 12:08:56 -0700
X-Trace: forums-1-dub 1065726536 10.22.108.75 (9 Oct 2003 12:08:56 -0700)
X-Original-Trace: 9 Oct 2003 12:08:56 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1840
Article PK: 17396

Sybase Adaptive Server Anywhere Network Server Version 8.0.2.3601


How can I specify a pattern used in a LIKE expression that can
ignore one or more white spaces.

So for example I have the following strings stored in a table
row1: 'abcdefg'
row2: 'abcd efg'
row3: 'abcd efg'

How can I specify a search condition that will return all the three rows.
I want to say ignore one or more white spaces in the search.
LIKE 'abcd[ what to put here ]efg'


Thanks
Mousa


Nick Elson Posted on 2003-10-10 06:56:20.0Z
From: "Nick Elson" <no_spam_nicelson@sybase.com>
Newsgroups: ianywhere.public.general
References: <3f85b316@forums-2-dub>
Subject: Re: multi-white space pattern search
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: vpn-concord-058.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-058.sybase.com
Message-ID: <3f865814$1@forums-1-dub>
Date: 9 Oct 2003 23:56:20 -0700
X-Trace: forums-1-dub 1065768980 158.159.8.58 (9 Oct 2003 23:56:20 -0700)
X-Original-Trace: 9 Oct 2003 23:56:20 -0700, vpn-concord-058.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1841
Article PK: 4089

Try

LIKE 'abcd%efg'

"Mousa Shaya" <NOSPAM_Mousa.Shaya@nokia.com> wrote in message
news:3f85b316@forums-2-dub...
> Sybase Adaptive Server Anywhere Network Server Version 8.0.2.3601
>
>
> How can I specify a pattern used in a LIKE expression that can
> ignore one or more white spaces.
>
> So for example I have the following strings stored in a table
> row1: 'abcdefg'
> row2: 'abcd efg'
> row3: 'abcd efg'
>
> How can I specify a search condition that will return all the three rows.
> I want to say ignore one or more white spaces in the search.
> LIKE 'abcd[ what to put here ]efg'
>
>
> Thanks
> Mousa
>
>
>
>


John Smirnios Posted on 2003-10-10 14:51:56.0Z
From: John Smirnios <smirnios@sybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: multi-white space pattern search
References: <3f85b316@forums-2-dub> <3f865814$1@forums-1-dub>
In-Reply-To: <3f865814$1@forums-1-dub>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: smirnios-pc.sybase.com
X-Original-NNTP-Posting-Host: smirnios-pc.sybase.com
Message-ID: <3f86c78c$1@forums-1-dub>
Date: 10 Oct 2003 07:51:56 -0700
X-Trace: forums-1-dub 1065797516 172.31.143.84 (10 Oct 2003 07:51:56 -0700)
X-Original-Trace: 10 Oct 2003 07:51:56 -0700, smirnios-pc.sybase.com
Lines: 47
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1842
Article PK: 17400

That would also match 'abcdqefg'. The pattern string language for LIKE
is not expressive enough to handle "zero or more white space characters".

--
John Smirnios
Senior Software Developer
iAnywhere Solutions Engineering

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

Nick Elson wrote:
> Try
>
> LIKE 'abcd%efg'
>
>
>
> "Mousa Shaya" <NOSPAM_Mousa.Shaya@nokia.com> wrote in message
> news:3f85b316@forums-2-dub...
>
>>Sybase Adaptive Server Anywhere Network Server Version 8.0.2.3601
>>
>>
>>How can I specify a pattern used in a LIKE expression that can
>>ignore one or more white spaces.
>>
>>So for example I have the following strings stored in a table
>>row1: 'abcdefg'
>>row2: 'abcd efg'
>>row3: 'abcd efg'
>>
>>How can I specify a search condition that will return all the three rows.
>>I want to say ignore one or more white spaces in the search.
>>LIKE 'abcd[ what to put here ]efg'
>>
>>
>>Thanks
>>Mousa
>>
>>
>>
>>
>
>
>


Jim Diaz Posted on 2003-10-17 16:06:26.0Z
From: "Jim Diaz" <NOSPAMjdiaz@emprisecorporation.com>
Newsgroups: ianywhere.public.general
References: <3f85b316@forums-2-dub>
Subject: Re: multi-white space pattern search
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 209.182.73.66
X-Original-NNTP-Posting-Host: 209.182.73.66
Message-ID: <3f901382$1@forums-1-dub>
Date: 17 Oct 2003 09:06:26 -0700
X-Trace: forums-1-dub 1066406786 209.182.73.66 (17 Oct 2003 09:06:26 -0700)
X-Original-Trace: 17 Oct 2003 09:06:26 -0700, 209.182.73.66
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1871
Article PK: 4122

Mousa:

I think the replace function might work nicely here SELECT
REPLACE(AttributeName,' ','') AS xyz where xyz = 'abcdefg'

Jim

"Mousa Shaya" <NOSPAM_Mousa.Shaya@nokia.com> wrote in message
news:3f85b316@forums-2-dub...
> Sybase Adaptive Server Anywhere Network Server Version 8.0.2.3601
>
>
> How can I specify a pattern used in a LIKE expression that can
> ignore one or more white spaces.
>
> So for example I have the following strings stored in a table
> row1: 'abcdefg'
> row2: 'abcd efg'
> row3: 'abcd efg'
>
> How can I specify a search condition that will return all the three rows.
> I want to say ignore one or more white spaces in the search.
> LIKE 'abcd[ what to put here ]efg'
>
>
> Thanks
> Mousa
>
>
>
>


Reg Domaratzki Posted on 2003-10-10 15:12:09.0Z
From: "Reg Domaratzki" <Spam_bad_rdomarat@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <3f85b316@forums-2-dub>
Subject: Re: multi-white space pattern search
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: rdomarat-pc.sybase.com
X-Original-NNTP-Posting-Host: rdomarat-pc.sybase.com
Message-ID: <3f86cc49$1@forums-1-dub>
Date: 10 Oct 2003 08:12:09 -0700
X-Trace: forums-1-dub 1065798729 172.31.143.163 (10 Oct 2003 08:12:09 -0700)
X-Original-Trace: 10 Oct 2003 08:12:09 -0700, rdomarat-pc.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1843
Article PK: 17392

You'll likely need to write your own function to do this. I haven't checked
the syntax on this, but you should get the idea.

create function MyMatch (in @str long varchar)
return tinyint
begin
DECLARE i INTEGER;
IF LEFT( @str, 4 ) != 'abcd' THEN
RETURN 0;
END IF;
IF RIGHT ( @str, 3 ) != 'efg' THEN
RETURN 0;
END IF;
SET i = 5;
WHILE ( i < LENGTH(@str) - 3 ) LOOP
IF SUBSTRING( @str, i, 1) != ' ' THEN
RETURN 0;
END IF;
SET i = i + 1;
END LOOP;
RETURN 1;
end

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL

"Mousa Shaya" <NOSPAM_Mousa.Shaya@nokia.com> wrote in message
news:3f85b316@forums-2-dub...
> Sybase Adaptive Server Anywhere Network Server Version 8.0.2.3601
>
>
> How can I specify a pattern used in a LIKE expression that can
> ignore one or more white spaces.
>
> So for example I have the following strings stored in a table
> row1: 'abcdefg'
> row2: 'abcd efg'
> row3: 'abcd efg'
>
> How can I specify a search condition that will return all the three rows.
> I want to say ignore one or more white spaces in the search.
> LIKE 'abcd[ what to put here ]efg'
>
>
> Thanks
> Mousa
>
>
>
>