1. Saravanakumar Thangapandian
  2. PowerServer 2020 or older (Obsolete)
  3. Friday, 5 July 2019 16:24 PM UTC

Hi,

 

I'm using Power Builder Version 2017 R3 Build 1858.

Can anyone clarify the difference between object.data and rowscopy method.

In our project, there is a complicated data window object. Select query has few oracle function and has many tables join.

There is around 1000+ rows retrieved.

 

When the below line is executed, it is executing very fast in desktop version, but in web version it is taking around 5 mins.

dw_2.object.data = dw_1.object.data

 

But if I modified to rowscopy as below, it is executing very fast in both desktop and web version.

dw_1.rowscopy(1, dw_1.rowcount(), Primary!, dw_2, 1, Primary!)

 

So, what is the difference between these 2 methods. Can anyone elaborate?

Michael Kramer Accepted Answer Pending Moderation
  1. Saturday, 6 July 2019 09:03 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Saravanakumar,

I can't tell you why RowsCopy has a speed advantage in PowerServer Web. If it does, well - rewrite where relevant for performance reason.

object.data has other benefits: It can take any rectangular subset of rows and columns in one statement whereas RowsCopy/RowsMove/RowsDiscard all process data at the full row level.

I have often used object.data to pick out one or more columns and process them. Like:

dec{4} priceList
priceList = object.data[1, priceColNo, ll_rows, priceColNo]
for row = 1 to rows
priceList[row] *= ldec_exchangeRate
next
object.data[1, priceColNo, ll_rows, priceColNo] = priceList

Also, object.data supports qualifiers like .current, .original, and .selected. To compare with C#: object.data has some of the strengths of LINQ - despite invented mid 1990s - not too shabby IMHO

HTH /Michael

Comment
There are no comments made yet.
Saravanakumar Thangapandian Accepted Answer Pending Moderation
  1. Saturday, 6 July 2019 07:34 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Thanks Chris.

In my scenario I will not able to use sharedata, as this is kind of data backing up and main data window will get reset.

I thought rowscopy and object.data might have any difference. If these are same, then I will go ahead and modify the object.data to rowscopy.

But do you have any idea why object.data is too slow?

Thanks,

Saravanan.

Comment
  1. Chris Pollach @Appeon
  2. Saturday, 6 July 2019 14:05 PM UTC
Hi Saravanan;

The speed should be relatively the same. If not, please open a support tickets for this.

Have you tried ...

A) using a DataStore instead of DW Control for the 2nd DW?

B) adding a SetRedraw( False/True) before & after the DOT notation copy?

Regards ... Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 5 July 2019 16:34 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Hi Saravanakumar;

  Those two commands are functionally the same. The only thing faster would be to use a ShareData() command between the two DC's (and /or a DataStore).

Regards ... Chris

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.