1. SHIJILESH CHERROT
  2. PowerBuilder
  3. Saturday, 15 December 2018

My script below takes too much time.

/////////////////////////////////////////////////////////////////////

long ll_row
dec vl_amt[]

for ll_row=1 to dw_1.rowcount() //3000 records 
    dw_vl_amt[ll_row]=100
next

dw_1.object.acc_amt.primary= vl_amt 

/////////////////////////////////////////////////////////////////////

I found the issue, there is a computed feild in the datawindow. is there any way to stop recalculation of computed fields temporary?.

 

Accepted Answer
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Hi;

     I would copy the DC's DWO's buffer to a DataStore using DOT Notation. Make sure that the DS's DWO has no computed columns. Then perform your DWO update loop on the DS. After completing the loop, use DOT notation to copy the DS's data back to the DC.

    During the above process, use the SetReDraw(False). Then after the DWO buffer copy, use a Group calc() followed by a SetReSraw(True).

HTH

Regards ... Chris

Comment
Thanks it worked
  1. SHIJILESH CHERROT
  2. Sunday, 16 December 2018
Excellent news! :-)
  1. Chris Pollach
  2. Monday, 17 December 2018
There are no comments made yet.
  1. Sunday, 16 December 2018
  2. PowerBuilder
  3. # Permalink
Clarence Chamorro Accepted Answer Pending Moderation
1
Votes
Undo

Since to me you are setting a value of 100 to each row to that particular column. Why instead of doing it in a datawindow do it in the you datasource. It will be instantaneous as soon your dw open it will be there.

Regards,

Clarence.

Comment
There are no comments made yet.
  1. Tuesday, 18 December 2018
  2. PowerBuilder
  3. # 1
Roland Smith Accepted Answer Pending Moderation
1
Votes
Undo

There is a timing setting for expressions in the painter. I don't have my computer with me today and I don't remember the exact name of it.

Comment
please share whenever you get the chance.
  1. SHIJILESH CHERROT
  2. Monday, 17 December 2018
There are no comments made yet.
  1. Sunday, 16 December 2018
  2. PowerBuilder
  3. # 2
Aron Cox Accepted Answer Pending Moderation
0
Votes
Undo

My guess it it's the redraws that are taking place on every update that slow it down.

 

Try adding dw_1.SetRedraw(FALSE) just before the loop starts, and a dw_1.SetRedraw(TRUE) just after the loop.

 

Please report back and let us know what worked :)

Comment
No luck dear.
  1. SHIJILESH CHERROT
  2. Sunday, 16 December 2018
Actually it should be like this ( think). Have you tried that?



long ll_row

dec vl_amt[]

long ll_rowcount



ll_rowcount = dw_1.RowCount()

dw_vl_amt.SetRedrae(FALSE)

for ll_row=1 to ll_rowcount //3000 records

dw_vl_amt[ll_row]=100

next

dw_vl_amt.SetRedrae(TRUE)



dw_1.object.acc_amt.primary= vl_amt
  1. Aron Cox
  2. Sunday, 16 December 2018
There are no comments made yet.
  1. Saturday, 15 December 2018
  2. PowerBuilder
  3. # 3
Arthur Hefti Accepted Answer Pending Moderation
0
Votes
Undo

Hi 

PB allocates a new array every time you add an element. So when doing it from top down it's way faster.

for ll_row=dw_1.rowcount()  to 1 step -1 

The question is whether you could fill the rows in the DW simpler either in retrieve or directly instead of putting the values into an array first.

Regards Arthur

 

Comment
no luck dear.
  1. SHIJILESH CHERROT
  2. Sunday, 16 December 2018
There are no comments made yet.
  1. Saturday, 15 December 2018
  2. PowerBuilder
  3. # 4
Sivaprakash BKR Accepted Answer Pending Moderation
0
Votes
Undo

Long   ll_noofrows

 

ll_noofrows = dw_1.RowCount()

for ll_row=1 to ll_noofrows

 

Try this change

Happiness always

BKR Sivaprakash

 

Comment
There are no comments made yet.
  1. Saturday, 15 December 2018
  2. PowerBuilder
  3. # 5
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.