1. gili galili
  2. PowerBuilder
  3. Sunday, 6 November 2022 14:35 PM UTC

Hello,

 

Is there a way to check if any data in my DW changed?

Not specific column or a row.

Check the entire DW.

Something like   :

 

dwItemStatus l_status


l_status = dw_1.GetItemStatus(0 - row ,  0 - column ,  Primary!)

if l_status  = New! or l_status  = NewModified! or l_status = DataModified! Then

/////  change in data...

end if

 

but there is no option to use 0 - in row valiable...

 

Regargs,

Marina

gili galili Accepted Answer Pending Moderation
  1. Sunday, 13 November 2022 05:41 AM UTC
  2. PowerBuilder
  3. # 1

And what about this scenario?

 

Data in one of the fields was changed from 'a' --> 'b'

but then returned back to 'a'

 

What function will catch this? That actually the data was not changed?

 

Regards

Marina

 

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 13 November 2022 15:00 PM UTC
Hi Marina;

In that case, the column's "modified" flag wil be DataModified! but, you can still compare the value in the DWO"s "Original " buffer to the current"Primary* buffer. In your case A = A. If so, you can reset that columns status to "NotModified" via the SetItemStatus() command.

Regards ... Chris
  1. Helpful
  1. gili galili
  2. Thursday, 17 November 2022 05:59 AM UTC
Thank you Chris
  1. Helpful
There are no comments made yet.
gili galili Accepted Answer Pending Moderation
  1. Sunday, 6 November 2022 15:04 PM UTC
  2. PowerBuilder
  3. # 2

thank you very much

:)

Comment
  1. Miguel Leeuwe
  2. Sunday, 6 November 2022 15:57 PM UTC
Maybe also useful to look at the value of "DeletedCount()".
  1. Helpful 1
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 6 November 2022 14:47 PM UTC
  2. PowerBuilder
  3. # 3

Hi Marina;

   That is what the ModifiedCount() command is for ...

https://docs.appeon.com/pb2022/datawindow_reference/dwmeth_ModifiedCount.html 

HTH

Regards... Chris 

 

Comment
  1. Kevin Ridley
  2. Monday, 7 November 2022 13:11 PM UTC
To add to what Chris and Miguel said, the best way to do this is as the PFC does it. Use IF dw_1.ModifiedCount() + dw_1.DeletedCount() > 0 THEN //dw data changed.
  1. Helpful 2
  1. Berka Frenfert
  2. Tuesday, 8 November 2022 06:15 AM UTC
Hi Kevin,

Will it work if Original and Current buffers are compared with IF?



Does modified count do equality check internally between the buffers?



dwcontrol.Object.Data {.buffer } {.datasource } [ startrownum, startcolnum, endrownum, endcolnum ]



EQUAL



dwcontrol.Object.Data {.buffer } {.datasource } [ startrownum, startcolnum, endrownum, endcolnum ]

  1. Helpful
  1. John Fauss
  2. Tuesday, 8 November 2022 14:51 PM UTC
You could test that hypothesis, but I suspect the ModifiedCount() function checks each row's status to see if it is either NewModified! or DataModified! and adds 1 if true. To test, I would change a data value in a row/column, use SetItemStatus to change the status from DataModified1 to NotModified!, then see what ModifiedCount() returns.

If one could peek "under the covers" into the DataWindow engine, I would not be surprised to find that it keeps a running total of modified rows so that it does not have to examine each row's status. Comparison of the Original and Primary data buffers, even if doable or feasible, might incur significant overhead to construct and populate the buffer "objects", but that is but conjecture on my part.
  1. Helpful 1
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.