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.

Search with repeating characters excludes matching data

4 posts in General Discussion (old) Last posting was on 2008-03-07 18:37:13.0Z
Michael Ray Posted on 2008-03-05 20:20:04.0Z
Reply-To: "Michael Ray" <ray6@SoftwareForToday.com>
From: "Michael Ray" <ray6@SoftwareForToday.com>
Newsgroups: sybase.public.sqlanywhere
Subject: Search with repeating characters excludes matching data
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47cf0074$1@forums-1-dub>
Date: 5 Mar 2008 12:20:04 -0800
X-Trace: forums-1-dub 1204748404 10.22.241.152 (5 Mar 2008 12:20:04 -0800)
X-Original-Trace: 5 Mar 2008 12:20:04 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:74
Article PK: 866529

When a search pattern contains 2 or more repeating characters ('%00',
'%000', '%xxx'), some data is incorrectly not found.
Data that has 1 additional character compared to the search is excluded. If
you search with two x (%xx), data that ends with 3 (xxx) is not found;
search with three x (%xxx), data that ends with 4 (xxxx) is not found. This
occurs in PB or ISQL.

For example, the search '%00' will not find data ending in '000'. It seems
the fix is to enclose one of the repeating characters in square brackets
('%0[0]').

Why is this? Any insights?
Is there a better fix? (So you don't have to type the brackets).
- Changing the search string with PB code before Retrieve() is one
option.

Example sql:
select *
from part
where part_num like '%00'
;
part_num 'abc000' is excluded.
Fix: use square brackets around one of the repeating characters (%0[0],
%[0]0, %[0][0]).

ASA database version 9.0.2
--
Michael Ray


anil k goel Posted on 2008-03-06 15:23:17.0Z
From: "anil k goel" <anilgoel@nowhere.com>
Newsgroups: sybase.public.sqlanywhere
References: <47cf0074$1@forums-1-dub>
Subject: Re: Search with repeating characters excludes matching data
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47d00c65$1@forums-1-dub>
Date: 6 Mar 2008 07:23:17 -0800
X-Trace: forums-1-dub 1204816997 10.22.241.152 (6 Mar 2008 07:23:17 -0800)
X-Original-Trace: 6 Mar 2008 07:23:17 -0800, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:75
Article PK: 866527

Michael,

Thanks for the report -- the following will likely constitute a software
defect that needs fixing.

However, I am unable to reproduce the problem with the current version of
9.0.2 with a simple example. Would you be kind enough to provide a
reproducible example (will likely need data that shows the problem)?

Also, please specify the build number of 9.0.2 that you are using. I want to
make sure that the build you are using contains some fixes to LIKE problems
of the kind you are reporting that were made in some early builds of 9.0.2.

Thanks,

-anil

"Michael Ray" <ray6@SoftwareForToday.com> wrote in message
news:47cf0074$1@forums-1-dub...
> When a search pattern contains 2 or more repeating characters ('%00',
> '%000', '%xxx'), some data is incorrectly not found.
> Data that has 1 additional character compared to the search is excluded.
> If
> you search with two x (%xx), data that ends with 3 (xxx) is not found;
> search with three x (%xxx), data that ends with 4 (xxxx) is not found.
> This
> occurs in PB or ISQL.
>
> For example, the search '%00' will not find data ending in '000'. It seems
> the fix is to enclose one of the repeating characters in square brackets
> ('%0[0]').
>
> Why is this? Any insights?
> Is there a better fix? (So you don't have to type the brackets).
> - Changing the search string with PB code before Retrieve() is one
> option.
>
> Example sql:
> select *
> from part
> where part_num like '%00'
> ;
> part_num 'abc000' is excluded.
> Fix: use square brackets around one of the repeating characters (%0[0],
> %[0]0, %[0][0]).
>
> ASA database version 9.0.2
> --
> Michael Ray
>
>
>
>
>


Michael Ray Posted on 2008-03-07 14:44:17.0Z
Reply-To: "Michael Ray" <ray6@SoftwareForToday.com>
From: "Michael Ray" <ray6@SoftwareForToday.com>
Newsgroups: sybase.public.sqlanywhere
References: <47cf0074$1@forums-1-dub> <47d00c65$1@forums-1-dub>
Subject: Re: Search with repeating characters excludes matching data
Lines: 88
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47d154c1$1@forums-1-dub>
Date: 7 Mar 2008 06:44:17 -0800
X-Trace: forums-1-dub 1204901057 10.22.241.152 (7 Mar 2008 06:44:17 -0800)
X-Original-Trace: 7 Mar 2008 06:44:17 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:76
Article PK: 866528

Please let me know your findings and what build # is available for general
release that would solve this issue.

ASA 9.0.2.2451

CREATE TABLE part2 (
part_num VARCHAR(15),
description VARCHAR(35) NOT NULL,
PRIMARY KEY (part_num)
) IN system
;
INSERT INTO part2 (part_num, description)
VALUES ('abc000', 'test part 1')
;
INSERT INTO part2 (part_num, description)
VALUES ('abc00', 'test part 2')
;
COMMIT
;
SELECT *
FROM part2
WHERE part_num LIKE '%00'
;
//part abc000 is not in the result set, but should be

--
Michael Ray

"anil k goel" <anilgoel@nowhere.com> wrote in message
news:47d00c65$1@forums-1-dub...
> Michael,
>
> Thanks for the report -- the following will likely constitute a software
> defect that needs fixing.
>
> However, I am unable to reproduce the problem with the current version of
> 9.0.2 with a simple example. Would you be kind enough to provide a
> reproducible example (will likely need data that shows the problem)?
>
> Also, please specify the build number of 9.0.2 that you are using. I want
> to make sure that the build you are using contains some fixes to LIKE
> problems of the kind you are reporting that were made in some early builds
> of 9.0.2.
>
> Thanks,
>
> -anil
>
>
> "Michael Ray" <ray6@SoftwareForToday.com> wrote in message
> news:47cf0074$1@forums-1-dub...
>> When a search pattern contains 2 or more repeating characters ('%00',
>> '%000', '%xxx'), some data is incorrectly not found.
>> Data that has 1 additional character compared to the search is excluded.
>> If
>> you search with two x (%xx), data that ends with 3 (xxx) is not found;
>> search with three x (%xxx), data that ends with 4 (xxxx) is not found.
>> This
>> occurs in PB or ISQL.
>>
>> For example, the search '%00' will not find data ending in '000'. It
>> seems
>> the fix is to enclose one of the repeating characters in square brackets
>> ('%0[0]').
>>
>> Why is this? Any insights?
>> Is there a better fix? (So you don't have to type the brackets).
>> - Changing the search string with PB code before Retrieve() is one
>> option.
>>
>> Example sql:
>> select *
>> from part
>> where part_num like '%00'
>> ;
>> part_num 'abc000' is excluded.
>> Fix: use square brackets around one of the repeating characters (%0[0],
>> %[0]0, %[0][0]).
>>
>> ASA database version 9.0.2
>> --
>> Michael Ray


anil k goel Posted on 2008-03-07 18:37:13.0Z
From: "anil k goel" <anilgoel@nowhere.com>
Newsgroups: sybase.public.sqlanywhere
References: <47cf0074$1@forums-1-dub> <47d00c65$1@forums-1-dub> <47d154c1$1@forums-1-dub>
Subject: Re: Search with repeating characters excludes matching data
Lines: 121
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47d18b59$1@forums-1-dub>
Date: 7 Mar 2008 10:37:13 -0800
X-Trace: forums-1-dub 1204915033 10.22.241.152 (7 Mar 2008 10:37:13 -0800)
X-Original-Trace: 7 Mar 2008 10:37:13 -0800, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:77
Article PK: 866530

The build you are using is indeed a bit old -- your example works fine with
the current software.

I believe the problem you are encountering was fixed in early 2005 in build
3032. Here is a description of the bug fix made (#379740).

-anil
Customer Description:

A LIKE condition is incorrectly evaluated to false under the following
conditions:

- the pattern string starts with _(underscore) or % (percent) and ends with
at least

two non-wildcard characters, e.g. '%00'

- the string expression ends with at least two occurences of the
non-wildcard characters

sequence that overlap

For example: '1000' LIKE '%00' would return false. This has been fixed.

"Michael Ray" <ray6@SoftwareForToday.com> wrote in message
news:47d154c1$1@forums-1-dub...
> Please let me know your findings and what build # is available for general
> release that would solve this issue.
>
> ASA 9.0.2.2451
>
> CREATE TABLE part2 (
> part_num VARCHAR(15),
> description VARCHAR(35) NOT NULL,
> PRIMARY KEY (part_num)
> ) IN system
> ;
> INSERT INTO part2 (part_num, description)
> VALUES ('abc000', 'test part 1')
> ;
> INSERT INTO part2 (part_num, description)
> VALUES ('abc00', 'test part 2')
> ;
> COMMIT
> ;
> SELECT *
> FROM part2
> WHERE part_num LIKE '%00'
> ;
> //part abc000 is not in the result set, but should be
>
> --
> Michael Ray
>
> "anil k goel" <anilgoel@nowhere.com> wrote in message
> news:47d00c65$1@forums-1-dub...
>> Michael,
>>
>> Thanks for the report -- the following will likely constitute a software
>> defect that needs fixing.
>>
>> However, I am unable to reproduce the problem with the current version of
>> 9.0.2 with a simple example. Would you be kind enough to provide a
>> reproducible example (will likely need data that shows the problem)?
>>
>> Also, please specify the build number of 9.0.2 that you are using. I want
>> to make sure that the build you are using contains some fixes to LIKE
>> problems of the kind you are reporting that were made in some early
>> builds
>> of 9.0.2.
>>
>> Thanks,
>>
>> -anil
>>
>>
>> "Michael Ray" <ray6@SoftwareForToday.com> wrote in message
>> news:47cf0074$1@forums-1-dub...
>>> When a search pattern contains 2 or more repeating characters ('%00',
>>> '%000', '%xxx'), some data is incorrectly not found.
>>> Data that has 1 additional character compared to the search is excluded.
>>> If
>>> you search with two x (%xx), data that ends with 3 (xxx) is not found;
>>> search with three x (%xxx), data that ends with 4 (xxxx) is not found.
>>> This
>>> occurs in PB or ISQL.
>>>
>>> For example, the search '%00' will not find data ending in '000'. It
>>> seems
>>> the fix is to enclose one of the repeating characters in square brackets
>>> ('%0[0]').
>>>
>>> Why is this? Any insights?
>>> Is there a better fix? (So you don't have to type the brackets).
>>> - Changing the search string with PB code before Retrieve() is one
>>> option.
>>>
>>> Example sql:
>>> select *
>>> from part
>>> where part_num like '%00'
>>> ;
>>> part_num 'abc000' is excluded.
>>> Fix: use square brackets around one of the repeating characters (%0[0],
>>> %[0]0, %[0][0]).
>>>
>>> ASA database version 9.0.2
>>> --
>>> Michael Ray
>
>
>
>
>
>