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.

Q] End of DataWindow again!

4 posts in Windows NT Last posting was on 1997-10-27 20:46:46.0Z
anonymous Posted on 1997-10-25 02:16:12.0Z
From: "anonymous" <fake@isp.com>
Subject: Q] End of DataWindow again!
Message-ID: <01bce0f2$f1287840$LocalHost@jsz07>
X-Newsreader: Microsoft Internet News 4.70.1157
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Newsgroups: powersoft.public.powerbuilder.database,sybase.public.sqlserver.nt
Date: Fri, 24 Oct 1997 22:16:12 -0400
Lines: 21
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub powersoft.public.powerbuilder.database:2761 sybase.public.sqlserver.nt:481
Article PK: 1158305

Hi,all
First,great thanks for Mr.Joe Choong answer my question,but I still
have the same question,let me say it in detail:
I will read all the data in on of my database's table to find the best
match
record,in Delphi (I use Delphi very well),I can do this like:

Table1.First; // ScrollToRow(0)
While NOT Table1.EOF do begin // do while NOT table1.EndOfFile
.... // to detect if the current record matched
Table1.Next; // ScrollNextRow
end;

But I can NOT do this in PB (I use PB very bad),what the condition is
if I will try this:

dw_1.ScrollToRow(0)
do while NOT dw_1.?????
... //to detect if the current record matched
dw_1.ScrollNextRow()
loop

Or any other good idea?
--
Any help would be appreciated and please reply by news.
Thanks a million.


Geert Van Damme Posted on 1997-10-27 19:51:14.0Z
From: "Geert Van Damme" <Geert.vandamme@bvpartners.be>
References: <01bce0f2$f1287840$LocalHost@jsz07>
Subject: Re: Q] End of DataWindow again!
Date: Mon, 27 Oct 1997 20:51:14 +0100
Lines: 17
Organization: Darling
X-Newsreader: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Message-ID: <mrn6Xiw48GA.174@forums.powersoft.com>
Newsgroups: powersoft.public.powerbuilder.database,sybase.public.sqlserver.nt
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub powersoft.public.powerbuilder.database:2759 sybase.public.sqlserver.nt:479
Article PK: 1158301

The answer Leo gives is a perfect answer to your question.
However, You should try it the more correct C/S way.
I don't know what your criteria are to call a record the 'matching' record,
but I guess this can be translated into SQL.

The best way then is to retrieve anly the rows you need.
Let the server do all the work. (With server I don't necessarily mean
another machine, It can be the database engine.)
If you compare your strategy to the C/S metaphore, it is like ordering
anything on the menu card. Check everything and only eat or drink what you
want.
Why not ask for the right thing from the beginning?

Geert 'Darling' Van Damme


Don Roof [TeamPS] Posted on 1997-10-27 20:46:46.0Z
From: droof@netmcr.com (Don Roof [TeamPS])
Subject: Re: Q] End of DataWindow again!
Date: Mon, 27 Oct 1997 15:46:46 -0500
Message-ID: <MPG.ebec7c38ebf7f469896a8@forums.powersoft.com>
References: <01bce0f2$f1287840$LocalHost@jsz07> <mrn6Xiw48GA.174@forums.powersoft.com>
Organization: FiTECH SYSTEMS
X-Newsreader: Anawave Gravity v2.00.753
Newsgroups: powersoft.public.powerbuilder.database,sybase.public.sqlserver.nt
Lines: 5
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub powersoft.public.powerbuilder.database:2758 sybase.public.sqlserver.nt:478
Article PK: 1158299

Excellent reply Geert! Why scroll through all the rows if you can limit
what you're looking for?

--
Regards,
Don Roof [TeamPS]
droof@netmcr.com


Leo Tohill Posted on 1997-10-25 18:55:28.0Z
From: 72330.1134@compuserve.com (Leo Tohill)
Subject: Re: Q] End of DataWindow again!
Date: Sat, 25 Oct 1997 18:55:28 GMT
Message-ID: <34523f3a.4017485@forums.powersoft.com>
References: <01bce0f2$f1287840$LocalHost@jsz07>
X-Newsreader: Forte Free Agent 1.1/32.230
Newsgroups: powersoft.public.powerbuilder.database,sybase.public.sqlserver.nt
Lines: 21
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub powersoft.public.powerbuilder.database:2760 sybase.public.sqlserver.nt:480
Article PK: 1158304


> dw_1.ScrollToRow(0)
> do while NOT dw_1.?????
> ... //to detect if the current record matched
> dw_1.ScrollNextRow()
> loop

{Retrieve() the dw)
LONG ll_row, ll_rows
ll_rows = dw_1.Rowcount() // determine number of rows retrieved
For ll_row = 1 to ll_rows // for each row
if dw_1.GetItemString(ll_row, "columnname") = value to match THEN
EXIT
End If;
next;


It is not necessary to scrolltorow in order to access the contents of
the row. The above method will give better performance. Use
ScrollToRow() only if you want the user to see a visual indication of
the row-to-row search.

For even better performance, see the FIND() function for datawindows.

Regards,



Leo Tohill - Team Powersoft
> Please post in newsgroup - I don't respond to email requests <