1. SHIJILESH CHERROT
  2. PowerBuilder
  3. Saturday, 15 December 2018 13:00 PM UTC

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 @Appeon Accepted Answer Pending Moderation
  1. Sunday, 16 December 2018 05:25 AM UTC
  2. PowerBuilder
  3. # Permalink

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
  1. SHIJILESH CHERROT
  2. Sunday, 16 December 2018 07:19 AM UTC
Thanks it worked
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 17 December 2018 15:40 PM UTC
Excellent news! :-)
  1. Helpful
There are no comments made yet.
Clarence Chamorro Accepted Answer Pending Moderation
  1. Tuesday, 18 December 2018 00:53 AM UTC
  2. PowerBuilder
  3. # 1

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.
Roland Smith Accepted Answer Pending Moderation
  1. Sunday, 16 December 2018 19:42 PM UTC
  2. PowerBuilder
  3. # 2

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
  1. SHIJILESH CHERROT
  2. Monday, 17 December 2018 04:09 AM UTC
please share whenever you get the chance.
  1. Helpful
There are no comments made yet.
Aron Cox Accepted Answer Pending Moderation
  1. Saturday, 15 December 2018 15:02 PM UTC
  2. PowerBuilder
  3. # 3

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
  1. SHIJILESH CHERROT
  2. Sunday, 16 December 2018 04:14 AM UTC
No luck dear.
  1. Helpful
  1. Aron Cox
  2. Sunday, 16 December 2018 21:50 PM UTC
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. Helpful
There are no comments made yet.
Arthur Hefti Accepted Answer Pending Moderation
  1. Saturday, 15 December 2018 14:12 PM UTC
  2. PowerBuilder
  3. # 4

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
  1. SHIJILESH CHERROT
  2. Sunday, 16 December 2018 04:22 AM UTC
no luck dear.
  1. Helpful
There are no comments made yet.
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Saturday, 15 December 2018 13:10 PM UTC
  2. PowerBuilder
  3. # 5

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.
  • Page :
  • 1


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