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 problem return -1

4 posts in DataWindow Last posting was on 2009-10-08 13:02:52.0Z
Miguel Morin Posted on 2009-10-08 12:47:40.0Z
From: "Miguel Morin" <mmorin@garaga.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: datastore problem return -1
Lines: 17
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4acddf6c$1@forums-1-dub>
Date: 8 Oct 2009 05:47:40 -0700
X-Trace: forums-1-dub 1255006060 10.22.241.152 (8 Oct 2009 05:47:40 -0700)
X-Original-Trace: 8 Oct 2009 05:47:40 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90071
Article PK: 409675

Hi

I have a very strange problem. I have a datastore with a select statement
with sql code in it. The datastore is declare a retrieved in the code of a
button. In the button, I have some code that retrieve the datastore and
check the rowcount. Without any changes on the data on the database, if I
click several times the button some time (about one in 10 to 100) the
datastore return -1 and no rowcount (usually the rowcount is 3). When it
return -1, the sqlcode is 0 and there is no sqlerrtext messsage.

Does someones have a clue. What are the reasons that a datastore will
return -1 in the retrieve function if there is no error in the sql statement
or database access ?

Thanks you for your help
Miguel


Miguel Morin Posted on 2009-10-08 12:48:25.0Z
From: "Miguel Morin" <mmorin@garaga.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4acddf6c$1@forums-1-dub>
In-Reply-To: <4acddf6c$1@forums-1-dub>
Subject: Re: datastore problem return -1
Lines: 21
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4acddf99$1@forums-1-dub>
Date: 8 Oct 2009 05:48:25 -0700
X-Trace: forums-1-dub 1255006105 10.22.241.152 (8 Oct 2009 05:48:25 -0700)
X-Original-Trace: 8 Oct 2009 05:48:25 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90072
Article PK: 409677

I want to add that i use powerbuilder 11.5 and sql server 2005

"Miguel Morin" <mmorin@garaga.com> wrote in message
news:4acddf6c$1@forums-1-dub...
> Hi
>
> I have a very strange problem. I have a datastore with a select statement
> with sql code in it. The datastore is declare a retrieved in the code of a
> button. In the button, I have some code that retrieve the datastore and
> check the rowcount. Without any changes on the data on the database, if I
> click several times the button some time (about one in 10 to 100) the
> datastore return -1 and no rowcount (usually the rowcount is 3). When it
> return -1, the sqlcode is 0 and there is no sqlerrtext messsage.
>
> Does someones have a clue. What are the reasons that a datastore will
> return -1 in the retrieve function if there is no error in the sql
> statement or database access ?
>
> Thanks you for your help
> Miguel


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2009-10-08 13:01:25.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4acddf6c$1@forums-1-dub> <4acddf99$1@forums-1-dub>
Subject: Re: datastore problem return -1
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Response
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: <4acde2a5$1@forums-1-dub>
Date: 8 Oct 2009 06:01:25 -0700
X-Trace: forums-1-dub 1255006885 10.22.241.152 (8 Oct 2009 06:01:25 -0700)
X-Original-Trace: 8 Oct 2009 06:01:25 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90074
Article PK: 409681

Wild guess: if you call retrieve again before the previous one is done, the
DBMS doesn't like it.
Workaround: disable button [and SetPointer(Hourglass!)], retrieve, enable
button [and SetPointer(Arrow!)]

--
Report Bugs to Sybase: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

"Miguel Morin" <mmorin@garaga.com> wrote in message
news:4acddf99$1@forums-1-dub...
>I want to add that i use powerbuilder 11.5 and sql server 2005
>
> "Miguel Morin" <mmorin@garaga.com> wrote in message
> news:4acddf6c$1@forums-1-dub...
>> Hi
>>
>> I have a very strange problem. I have a datastore with a select statement
>> with sql code in it. The datastore is declare a retrieved in the code of
>> a button. In the button, I have some code that retrieve the datastore and
>> check the rowcount. Without any changes on the data on the database, if I
>> click several times the button some time (about one in 10 to 100) the
>> datastore return -1 and no rowcount (usually the rowcount is 3). When it
>> return -1, the sqlcode is 0 and there is no sqlerrtext messsage.
>>
>> Does someones have a clue. What are the reasons that a datastore will
>> return -1 in the retrieve function if there is no error in the sql
>> statement or database access ?
>>
>> Thanks you for your help
>> Miguel
>


Scott Morris Posted on 2009-10-08 13:02:52.0Z
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4acddf6c$1@forums-1-dub>
Subject: Re: datastore problem return -1
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Response
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: <4acde2fc$1@forums-1-dub>
Date: 8 Oct 2009 06:02:52 -0700
X-Trace: forums-1-dub 1255006972 10.22.241.152 (8 Oct 2009 06:02:52 -0700)
X-Original-Trace: 8 Oct 2009 06:02:52 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90075
Article PK: 409680


"Miguel Morin" <mmorin@garaga.com> wrote in message
news:4acddf6c$1@forums-1-dub...
> Hi
>
> I have a very strange problem. I have a datastore with a select statement
> with sql code in it. The datastore is declare a retrieved in the code of a
> button. In the button, I have some code that retrieve the datastore and
> check the rowcount. Without any changes on the data on the database, if I
> click several times the button some time (about one in 10 to 100) the
> datastore return -1 and no rowcount (usually the rowcount is 3). When it
> return -1, the sqlcode is 0 and there is no sqlerrtext messsage.
>
> Does someones have a clue. What are the reasons that a datastore will
> return -1 in the retrieve function if there is no error in the sql
> statement or database access ?

Your only clue will come from the dberror event - retrieval errors that
occur in a datawindow control or a datastore can only be captured in the
dberror event of the object. If you are actually creating a basic datastore
object, this event will be empty and you will be unable to diagnose or
respond to errors in a useful manner. Note - the attributes of transaction
object are not set when a retrieve fails.

As a side note, I would reconsider your approach of creating, retrieving,
and destroying (hopefully - you did not indicate that you are cleaning up
all of your dynamic allocations and posted no code) a datastore - especially
in a button's clicked event.