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.

datastore find(ls_expr, 0, 0) gives 1?

2 posts in DataWindow Last posting was on 2009-12-02 16:24:27.0Z
Chris Werner Posted on 2009-12-01 11:11:11.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: datastore find(ls_expr, 0, 0) gives 1?
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b14f9cf$1@forums-1-dub>
Date: 1 Dec 2009 03:11:11 -0800
X-Trace: forums-1-dub 1259665871 10.22.241.152 (1 Dec 2009 03:11:11 -0800)
X-Original-Trace: 1 Dec 2009 03:11:11 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90378
Article PK: 409983

Hi,

I found as reason for an odd error in an application that the
datastore find method returns a row number which fits the
search expression but doesn't the row range. There is a
datastore with one row which fits a certain search expression
(ls_expr = "#1=1" in the present case). A long variable ll_rc
has the value 0 so

ids_1.find(ls_expr, 0, ll_rc)

should return 0. But it doesn't, it returns 1. Is this an error
or am I thinking wrong? I know that one is easy to workaround
but may lurking in a lot of places.

Using PB 10.5.2 build 7611.

TIA

Chris Werner
f+s software gmbh


Scott Morris Posted on 2009-12-02 16:24:27.0Z
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b14f9cf$1@forums-1-dub>
Subject: Re: datastore find(ls_expr, 0, 0) gives 1?
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b1694bb$1@forums-1-dub>
Date: 2 Dec 2009 08:24:27 -0800
X-Trace: forums-1-dub 1259771067 10.22.241.152 (2 Dec 2009 08:24:27 -0800)
X-Original-Trace: 2 Dec 2009 08:24:27 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90385
Article PK: 409990


> datastore with one row which fits a certain search expression
> (ls_expr = "#1=1" in the present case). A long variable ll_rc
> has the value 0 so
>
> ids_1.find(ls_expr, 0, ll_rc)
>
> should return 0. But it doesn't, it returns 1. Is this an error
> or am I thinking wrong? I know that one is easy to workaround
> but may lurking in a lot of places.
>
> Using PB 10.5.2 build 7611.

The return value should NOT be 1, but the correct value is debatable. Since
[0, 0] is not a valid range, one could expect a return value of -1 or -5.
In 11.2, the return value is 0. I would double-check your analysis - find()
is a frequently used function and I would be surprized if it had such a bug.
If it is a bug, your options are rather limited due to the version you are
using.