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.

LIKE change between 9 & 10 ?

2 posts in Commercial ISV's Last posting was on 2009-03-19 14:05:09.0Z
Justin Willey Posted on 2009-03-19 14:02:40.0Z
From: "Justin Willey" <gjw@nospamatall.iqx.co.uk>
Newsgroups: sybase.public.commercial-isv.general
Subject: LIKE change between 9 & 10 ?
Lines: 34
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49c25080@forums-1-dub>
Date: 19 Mar 2009 06:02:40 -0800
X-Trace: forums-1-dub 1237471360 10.22.241.152 (19 Mar 2009 06:02:40 -0800)
X-Original-Trace: 19 Mar 2009 06:02:40 -0800, vip152.sybase.com
X-Authenticated-User: panorama
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.commercial-isv.general:283
Article PK: 104001

There seems to be a change in the way that LIKE (or possibly the IF
statement) handles nulls bewteen v9 & 10. I can't see any documented
behaviour change.

In v9.0.2.3207 this script

-------------------------------------------------------------
Create FUNCTION "pears"."TestLike"(in @NI char(10))
returns char(250)
begin
declare ResultMessage char(250);
if @NI not like 'A' then
set ResultMessage='Not Like'
end if;
return ResultMessage
end;

select TestLike(null);

select if null not like 'A' then 'Not Like' else 'Like' endif;
----------------------------------------------------------------

returns NULL for both selects.

But in v10.0.1.3831 select TestLike(null) returns 'Not Like'. The other
select still returns null.

From my understanding, the v9 behaviour is correct.

Justin Willey
IQX Ltd


Justin Willey Posted on 2009-03-19 14:05:09.0Z
From: "Justin Willey" <gjw@nospamatall.iqx.co.uk>
Newsgroups: sybase.public.commercial-isv.general
References: <49c25080@forums-1-dub>
Subject: Re: LIKE change between 9 & 10 ?
Lines: 40
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.3350
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49c25115@forums-1-dub>
Date: 19 Mar 2009 06:05:09 -0800
X-Trace: forums-1-dub 1237471509 10.22.241.152 (19 Mar 2009 06:05:09 -0800)
X-Original-Trace: 19 Mar 2009 06:05:09 -0800, vip152.sybase.com
X-Authenticated-User: panorama
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.commercial-isv.general:284
Article PK: 103999

Apologies - wrong newsgroup

"Justin Willey" <gjw@nospamatall.iqx.co.uk> wrote in message
news:49c25080@forums-1-dub...
> There seems to be a change in the way that LIKE (or possibly the IF
> statement) handles nulls bewteen v9 & 10. I can't see any documented
> behaviour change.
>
> In v9.0.2.3207 this script
>
> -------------------------------------------------------------
> Create FUNCTION "pears"."TestLike"(in @NI char(10))
> returns char(250)
> begin
> declare ResultMessage char(250);
> if @NI not like 'A' then
> set ResultMessage='Not Like'
> end if;
> return ResultMessage
> end;
>
> select TestLike(null);
>
> select if null not like 'A' then 'Not Like' else 'Like' endif;
> ----------------------------------------------------------------
>
> returns NULL for both selects.
>
> But in v10.0.1.3831 select TestLike(null) returns 'Not Like'. The other
> select still returns null.
>
> From my understanding, the v9 behaviour is correct.
>
> Justin Willey
> IQX Ltd
>
>
>