is there a faster way to get the number of rows in the primary buffer of
a dw?
Do I have to use dw_1.RowCount() or is there a dw object property that I
can access?
Thanks in advance!
Thorsten
HTH
Ron Gallagher, CPDP
Atlanta, GA
rongal...@mindspring.com
Thorsten Kummer wrote in message <37D663AC...@planet.de>...
Why?
On Wed, 08 Sep 1999 15:25:00 +0200,
in powersoft.public.powerbuilder.datawindow
Thorsten Kummer <Kum...@planet.de> wrote:
>Hi folks,
>
>is there a faster way to get the number of rows in the primary buffer of
>a dw?
>Do I have to use dw_1.RowCount() or is there a dw object property that I
>can access?
>
>Thanks in advance!
>Thorsten
>
---
Bruce Armstrong [TeamSybase] | Romac/Source International
mailto:Bruce.A...@teamsybase.com | http://www.kforce.com
| http://www.romac-source.com
Preach the gospel at all times. If necessary, use words. [Francis of Assisi]
http://www.kidbrothers.org http://www.fccwc.org
http://www.harvest.org/text/knowgod.html
-----------== Posted via the PFCGuide Web Newsreader ==----------
http://www.pfcguide.com/_newsgroups/group_list.asp
Simon
Thorsten Kummer wrote in message <37D663AC...@planet.de>...
You can use the SQLNROWS property of the transaction object (ex:
SQLCA.SQLNROWS) to get the number of rows retrieved. Also, the method
RETRIEVE() of a datawindows returns the number of rows read.
Good luck
Ron.
Thorsten Kummer a écrit dans le message <37D663AC...@planet.de>...
I have to implement a recursive treeview object which reads a table once into a
datastore and then processes the rows.
Each row contains a column with the reference to it's parent row, so implementing
the tree is very easy using a recursive function call.
I encountered very strange performance disadvantages, so I replaced all datawindow
function calls (GetItemNumber() and so on)
by statements that refer to the dw object in dot notation (value =
dw_1.Object.colimn[i]). The RowCount(),SetFilter() and Filter() calls are the only
ones that I'm using.
When processing 1000 rows performance is strong (2 seconds), but with 4000 rows my
computer (PII, 400 MHz) needs more than
40 seconds. Does it have something to do with the recursive call?
"Bruce Armstrong [TeamSybase]" schrieb:
> dw_x.RowCount is pretty much the main method. You could do something like
> set the value of an instance variable in a datawindow user object to the
> result of the rowcount argument to the retrieveend event. However, it
> wouldn't be updated (or you would have to update it) to account for filtering,
> deletes, etc. All in all, RowCount is the best method. It's also not
> particularly slow (that I've seen). Have you had a problem with it?
>
> On Wed, 08 Sep 1999 15:25:00 +0200,
> in powersoft.public.powerbuilder.datawindow
> Thorsten Kummer <Kum...@planet.de> wrote:
> >Hi folks,
> >
> >is there a faster way to get the number of rows in the primary buffer of
> >a dw?
> >Do I have to use dw_1.RowCount() or is there a dw object property that I
> >can access?
> >
> >Thanks in advance!
> >Thorsten
> >
>
Are you doing something like
for i=1 to dw_1.RowCount()
// stuff
next
if so, replace with
li_max = dw_1.RowCount()
for i=1 to li_max
// stuff
next
HTH
Simon
Thorsten Kummer wrote in message <37D75726...@planet.de>...
The recursive nature of the call 'may' be the cause of your problem.
However, I'd like to suggest a few alternatives:
1) Since you're using recursive logic, then you really only need to retrieve
the row count once. After retrieving it, store it in an instance variable
and just refer to that instance variable, instead of calling the RowCount()
method. Of course, if you're filtering the records, this won't work.
2) When you load the tree view, are you loading all levels of the tree view
or just the root level? If you're loading all levels, you may want to
rethink this. It's better to just load the root level initially, and then
load lower levels when the parent object expands for the first time. Your
initial load will run much faster, and you won't be loading data into the
tree view that the user never accesses.
3) Another thing to consider is the sorting within the treeview. If you can
properly sort the records in your datastore, then I'd recommend that you
turn off sorting within the treeview. Sorting records in the datastore is
much faster. Once you sort the records in the datastore, use the
InsertItemLast method to add items to the treeview. They will appear in the
order in which you add them.
HTH
Ron Gallagher, CPDP
Atlanta, GA
rongal...@mindspring.com
Thorsten Kummer wrote in message <37D75726...@planet.de>...
Or is there a way for the PFC service to handle this better than me???
3. The sorted property of the treeview m u s t be set to FALSE, otherwise
performance is decreasing rapidly!
I rather sort the datastore , process the treeview an set the sorted
property to true after all. This treeview sorting is very fast.
4. To Simon Caldwell:
Thank you for your tip! Dot notation speeded up my processing, however ...
Best regards
Thorsten
Ron Gallagher schrieb:
Paul Horan
VCI
Springfield, MA
Thorsten Kummer <Kum...@planet.de> wrote in message
news:37D7BC48...@planet.de...
Does this sound familiar at all? In any event, you may want to do embed some
timing test to determine specifically where the problem may be coming from.
FWIW, the CPU function is real handy for doing that.
On Thu, 09 Sep 1999 08:43:50 +0200,
in powersoft.public.powerbuilder.datawindow
Thorsten Kummer <Kum...@planet.de> wrote:
>No Bruce, I didn't really have a problem with it. Let me tell you what's going
on:
>
>I have to implement a recursive treeview object which reads a table once into a
>datastore and then processes the rows.
>Each row contains a column with the reference to it's parent row, so
implementing
>the tree is very easy using a recursive function call.
>I encountered very strange performance disadvantages, so I replaced all
datawindow
>function calls (GetItemNumber() and so on)
>by statements that refer to the dw object in dot notation (value =
>dw_1.Object.colimn[i]). The RowCount(),SetFilter() and Filter() calls are the
only
>ones that I'm using.
>When processing 1000 rows performance is strong (2 seconds), but with 4000 rows
my
>computer (PII, 400 MHz) needs more than
>40 seconds. Does it have something to do with the recursive call?
>
---
Bruce Armstrong [TeamSybase] | Romac/Source International
mailto:Bruce.A...@teamsybase.com | http://www.kforce.com
| http://www.romac-source.com
Preach the gospel at all times. If necessary, use words. [Francis of Assisi]
http://www.kidbrothers.org http://www.fccwc.org
http://www.harvest.org/knowgod/index.htm
Just an idea.
Mark Hill
mh...@lims.com
Ron Gallagher <rongal...@mindspring.com> wrote in message
news:B1Er6tr##GA....@forums.sybase.com...
> >No Bruce, I didn't really have a problem with it. Let me tell you what's
> going on:
> >
> >I have to implement a recursive treeview object which reads a table once
> into a
> >datastore and then processes the rows.
> >Each row contains a column with the reference to it's parent row, so
> implementing
> >the tree is very easy using a recursive function call.
> >I encountered very strange performance disadvantages, so I replaced all
> datawindow
> >function calls (GetItemNumber() and so on)
> >by statements that refer to the dw object in dot notation (value =
> >dw_1.Object.colimn[i]). The RowCount(),SetFilter() and Filter() calls are
> the only
> >ones that I'm using.
> >When processing 1000 rows performance is strong (2 seconds), but with
4000
> rows my
> >computer (PII, 400 MHz) needs more than
> >40 seconds. Does it have something to do with the recursive call?
> >
> >"Bruce Armstrong [TeamSybase]" schrieb:
> >
> >> dw_x.RowCount is pretty much the main method. You could do something
> like
> >> set the value of an instance variable in a datawindow user object to
the
> >> result of the rowcount argument to the retrieveend event. However, it
> >> wouldn't be updated (or you would have to update it) to account for
> filtering,
> >> deletes, etc. All in all, RowCount is the best method. It's also not
> >> particularly slow (that I've seen). Have you had a problem with it?
> >>
> >> On Wed, 08 Sep 1999 15:25:00 +0200,
> >> in powersoft.public.powerbuilder.datawindow
> >> Thorsten Kummer <Kum...@planet.de> wrote:
> >> >Hi folks,
> >> >
> >> >is there a faster way to get the number of rows in the primary buffer
of
> >> >a dw?
> >> >Do I have to use dw_1.RowCount() or is there a dw object property that
I
> >> >can access?
> >> >
> >> >Thanks in advance!
> >> >Thorsten
> >> >
> >>
> >> ---
> >> Bruce Armstrong [TeamSybase] | Romac/Source International
> >> mailto:Bruce.A...@teamsybase.com | http://www.kforce.com
> >> | http://www.romac-source.com
> >>
> >> Preach the gospel at all times. If necessary, use words. [Francis of
> Assisi]
> >> http://www.kidbrothers.org http://www.fccwc.org
> >> http://www.harvest.org/text/knowgod.html